aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/http/http.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-11-19 15:03:26 +0100
committerFlorin Coras <florin.coras@gmail.com>2024-11-19 19:29:50 +0000
commit258b82975b120b3deb34483254f1d40dca5bb79d (patch)
tree5444f1b3606c13b40dd470e89054bc3bdada612f /src/plugins/http/http.h
parent2ec8a9abc2b853bb7b0ce2649403a25fb29881ae (diff)
http: track requests as independent objects
Type: improvement Change-Id: I6c1808a82f61c71f34eab12ae5f99cca5fee8854 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/http/http.h')
-rw-r--r--src/plugins/http/http.h62
1 files changed, 40 insertions, 22 deletions
diff --git a/src/plugins/http/http.h b/src/plugins/http/http.h
index 19488fb7ff4..844235cbdbb 100644
--- a/src/plugins/http/http.h
+++ b/src/plugins/http/http.h
@@ -385,6 +385,45 @@ typedef struct http_msg_
http_msg_data_t data;
} http_msg_t;
+typedef struct http_req_
+{
+ http_req_state_t state; /* state-machine state */
+
+ http_buffer_t tx_buf; /* message body from app to be sent */
+
+ /*
+ * for parsing of incoming message from transport
+ */
+ u8 *rx_buf; /* this should hold at least control data */
+ u32 rx_buf_offset; /* current offset during parsing */
+ u32 control_data_len; /* start line + headers + empty line */
+
+ u64 to_recv; /* remaining bytes of message body to receive from transport */
+
+ u8 is_tunnel;
+
+ /*
+ * parsed metadata for app
+ */
+ union
+ {
+ http_status_code_t status_code;
+ http_req_method_t method;
+ };
+
+ http_target_form_t target_form;
+ u32 target_path_offset;
+ u32 target_path_len;
+ u32 target_query_offset;
+ u32 target_query_len;
+
+ u32 headers_offset;
+ u32 headers_len;
+
+ u32 body_offset;
+ u64 body_len;
+} http_req_t;
+
typedef struct http_tc_
{
union
@@ -406,28 +445,7 @@ typedef struct http_tc_
u8 *host;
u8 is_server;
- /*
- * Current request
- */
- http_req_state_t req_state;
- http_req_method_t method;
- u8 *rx_buf;
- u32 rx_buf_offset;
- http_buffer_t tx_buf;
- u64 to_recv;
- u32 bytes_dequeued;
- u32 control_data_len; /* start line + headers + empty line */
- http_target_form_t target_form;
- u32 target_path_offset;
- u32 target_path_len;
- u32 target_query_offset;
- u32 target_query_len;
- u32 headers_offset;
- u32 headers_len;
- u32 body_offset;
- u64 body_len;
- u16 status_code;
- u8 is_tunnel;
+ http_req_t req;
} http_conn_t;
typedef struct http_worker_