summaryrefslogtreecommitdiff
path: root/src/http_decoder_tunnel.h
diff options
context:
space:
mode:
authorlijia <[email protected]>2024-07-17 14:27:15 +0800
committerlijia <[email protected]>2024-07-18 09:54:56 +0800
commitc4c7aa89bf01b321f5b582d84b684171e6dbcf66 (patch)
tree37678010c572f18f5d439101a40cc1f832e0154a /src/http_decoder_tunnel.h
parentb1548c7c6dc2198a4df20b11ce8eb72e766f56b7 (diff)
Add BODY_START message; add http_url_decode(); disable CONNECT tunnel.HEADv2.0.4dev-on-stellar2.0
Diffstat (limited to 'src/http_decoder_tunnel.h')
-rw-r--r--src/http_decoder_tunnel.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/http_decoder_tunnel.h b/src/http_decoder_tunnel.h
index 2b67649..f908c1b 100644
--- a/src/http_decoder_tunnel.h
+++ b/src/http_decoder_tunnel.h
@@ -1,7 +1,6 @@
#pragma once
-
+#include "http_decoder_inc.h"
#include "http_decoder_half.h"
-#include "llhttp.h"
enum http_tunnel_state{
HTTP_TUN_NON = 0, // init, or not tunnel session
@@ -12,7 +11,23 @@ enum http_tunnel_state{
HTTP_TUN_INNER_TRANS, // http inner tunnel protocol transmitting
};
-int httpd_tunnel_identify(int curdir, struct http_decoder_half_data *hfdata);
+/************************************************************
+* HTTP TUNNEL WITH CONNECT METHOD.
+*************************************************************/
+struct http_tunnel_message;
+#define HTTP_DECODER_TUNNEL_TOPIC "HTTP_DECODER_TUNNEL_MESSAGE"
+
+enum http_tunnel_message_type {
+ HTTP_TUNNEL_OPENING,
+ HTTP_TUNNEL_ACTIVE,
+ HTTP_TUNNEL_CLOSING,
+ HTTP_TUNNEL_MSG_MAX
+};
+enum http_tunnel_message_type http_tunnel_message_type_get(const struct http_tunnel_message *tmsg);
+void http_tunnel_message_get_payload(const struct http_tunnel_message *tmsg, struct iovec *tunnel_payload);
+
+
+int httpd_tunnel_identify(struct http_decoder_env *httpd_env, 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);