summaryrefslogtreecommitdiff
path: root/plugin/protocol/http
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/protocol/http')
-rw-r--r--plugin/protocol/http/src/http_entry.cpp21
-rw-r--r--plugin/protocol/http/src/http_half.cpp11
2 files changed, 11 insertions, 21 deletions
diff --git a/plugin/protocol/http/src/http_entry.cpp b/plugin/protocol/http/src/http_entry.cpp
index 0c45447..54804fb 100644
--- a/plugin/protocol/http/src/http_entry.cpp
+++ b/plugin/protocol/http/src/http_entry.cpp
@@ -386,6 +386,7 @@ enum tfe_stream_action http_connection_entry(const struct tfe_stream * stream, e
bool __need_to_close_the_session = false;
int ret = 0;
+ int user_construct_ret = 0;
enum tfe_stream_action __action = ACTION_FORWARD_DATA;
size_t __action_args = 0;
@@ -454,6 +455,16 @@ enum tfe_stream_action http_connection_entry(const struct tfe_stream * stream, e
goto __passthrough;
}
+ user_construct_ret = (dir == CONN_DIR_DOWNSTREAM) ?
+ __on_request_handle_user_req_or_resp(stream, hs_private, hf_private_in, __need_to_close_the_session) :
+ __on_response_handle_user_req_or_resp(stream, hs_private, hf_private_in, __need_to_close_the_session);
+
+ if (user_construct_ret < 0)
+ {
+ assert(0);
+ goto __passthrough;
+ }
+
/* Need more data, no boundary touched */
if (ret == 0)
{
@@ -477,16 +488,6 @@ enum tfe_stream_action http_connection_entry(const struct tfe_stream * stream, e
goto __passthrough;
}
- ret = (dir == CONN_DIR_DOWNSTREAM) ?
- __on_request_handle_user_req_or_resp(stream, hs_private, hf_private_in, __need_to_close_the_session) :
- __on_response_handle_user_req_or_resp(stream, hs_private, hf_private_in, __need_to_close_the_session);
-
- if (ret < 0)
- {
- assert(0);
- goto __passthrough;
- }
-
/* Touch a boundary, such as the end of HTTP headers, bodys, et al. */
__action_args = hf_private_in->parse_cursor;
hf_private_in->parse_cursor = 0;
diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp
index 353ba2b..8e4d61e 100644
--- a/plugin/protocol/http/src/http_half.cpp
+++ b/plugin/protocol/http/src/http_half.cpp
@@ -377,17 +377,6 @@ static int __parser_callback_on_headers_complete(http_parser * parser)
hf_private->stream_action = ACTION_FORWARD_DATA;
}
- if (hs_private && hf_direction == TFE_HTTP_REQUEST && hs_private->hf_private_req_user != NULL)
- {
- http_parser_pause(parser, 1);
- assert(hf_private->stream_action != ACTION_FORWARD_DATA);
- }
- else if (hs_private && hf_direction == TFE_HTTP_RESPONSE && hs_private->hf_private_resp_user != NULL)
- {
- http_parser_pause(parser, 1);
- assert(hf_private->stream_action != ACTION_FORWARD_DATA);
- }
-
return 0;
}