diff options
| author | 李佳 <[email protected]> | 2024-06-20 10:59:55 +0000 |
|---|---|---|
| committer | 李佳 <[email protected]> | 2024-06-20 10:59:55 +0000 |
| commit | a2e5617ed5f32078b9e2fc1f1a2649aaef6b0eec (patch) | |
| tree | ed5d4b3392bdd577986d26ac8d5c6da21f9c2b2a /src/http_decoder_tunnel.h | |
| parent | 7d6170a23027aff0ebf2e7832dc11e4bbdce57ea (diff) | |
| parent | 05e8c9db6912dc95de9691e9b90e549a4c3beffe (diff) | |
Merge branch 'feat-connect-tunnel' into 'dev-on-stellar2.0'
feat: TSG-20446, support http tunnel with CONNECT method.
See merge request stellar/http_decoder!7
Diffstat (limited to 'src/http_decoder_tunnel.h')
| -rw-r--r-- | src/http_decoder_tunnel.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/http_decoder_tunnel.h b/src/http_decoder_tunnel.h new file mode 100644 index 0000000..b1e74df --- /dev/null +++ b/src/http_decoder_tunnel.h @@ -0,0 +1,21 @@ +#pragma once + +#include "http_decoder_half.h" +#include "llhttp.h" + +enum http_tunnel_state{ + HTTP_TUN_NON = 0, // init, or not tunnel session + HTTP_TUN_C2S_HDR_START, //CONNECT ... + HTTP_TUN_C2S_HDR_END, //CONNECT request all heades end with \r\n + HTTP_TUN_S2C_START, // HTTP 200 connet established + // HTTP_TUN_S2C_END, // http response all heades end with \r\n + HTTP_TUN_INNER_STARTING, // http inner tunnel protocol starting + HTTP_TUN_INNER_TRANS, // http inner tunnel protocol transmitting +}; + +int httpd_tunnel_identify(int curdir, struct http_decoder_half_data *hfdata); +int httpd_is_tunnel_session(const struct http_decoder_exdata *ex_data); +int httpd_in_tunnel_transmitting(struct http_decoder_exdata *ex_data); +void httpd_tunnel_state_update(struct http_decoder_exdata *ex_data); +void http_decoder_push_tunnel_data(struct session *sess, const struct http_decoder_exdata *exdata, enum http_tunnel_message_type type); +enum http_tunnel_message_type httpd_tunnel_state_to_msg(const struct http_decoder_exdata *ex_data);
\ No newline at end of file |
