From 8a0f3c8c3c79185aa346f70f13f1f84163254b66 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Fri, 19 Oct 2018 18:01:53 +0800 Subject: [PATCH] =?UTF-8?q?http=20resume=E5=90=8E=E5=BA=94=E7=BB=99tcp?= =?UTF-8?q?=E5=B1=82=E8=BF=94=E5=9B=9E=E5=BD=93=E5=89=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E7=BB=93=E6=9E=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/tcp_stream.cpp | 3 ++- plugin/protocol/http/src/http_entry.cpp | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/platform/src/tcp_stream.cpp b/platform/src/tcp_stream.cpp index bc7e762..24d17a6 100644 --- a/platform/src/tcp_stream.cpp +++ b/platform/src/tcp_stream.cpp @@ -624,7 +624,6 @@ __close_connection: //fprintf(stderr, "---- eventcb ----, close this connection, " // "stream = %p, event = %x, dir = %s\n", _stream, events, __str_dir); - assert((*ref_this_conn)->on_writing == 0); __conn_private_destory_with_ssl(ev_base, *ref_this_conn, *ref_this_ssl_stream); *ref_this_conn = NULL; *ref_this_ssl_stream = NULL; @@ -720,6 +719,7 @@ void ssl_downstream_create_on_success(future_result_t * result, void * user) void ssl_downstream_create_on_fail(enum e_future_error err, const char * what, void * user) { + fprintf(stderr, "---- downstream create fail !!!\n"); return; } @@ -750,6 +750,7 @@ void ssl_upstream_create_on_success(future_result_t * result, void * user) void ssl_upstream_create_on_fail(enum e_future_error err, const char * what, void * user) { + fprintf(stderr, "---- upstream create fail !!!\n"); return; } diff --git a/plugin/protocol/http/src/http_entry.cpp b/plugin/protocol/http/src/http_entry.cpp index 8d1e315..fa84675 100644 --- a/plugin/protocol/http/src/http_entry.cpp +++ b/plugin/protocol/http/src/http_entry.cpp @@ -241,8 +241,17 @@ enum tfe_stream_action __http_connection_entry_on_request(const struct tfe_strea goto __errout; } + if(hf_private_req_in->is_user_stream_action_set) + { + hf_private_req_in->stream_action = hf_private_req_in->user_stream_action; + } + else + { + hf_private_req_in->stream_action = ACTION_FORWARD_DATA; + } + /* Ignore parse the content which is nullptr. */ - goto __out; + goto __boundary; } /* Parse the content, the data which in defered state has been ignored. */ @@ -281,16 +290,17 @@ enum tfe_stream_action __http_connection_entry_on_request(const struct tfe_strea goto __errout; } - /* Touch a boundary, such as the end of HTTP headers, bodys, et al. */ - __action_args = hf_private_req_in->parse_cursor; - hf_private_req_in->parse_cursor = 0; - if (__on_request_handle_user_req_or_resp(stream, hs_private, hf_private_req_in, __need_to_close_the_session) < 0) { goto __errout; } +__boundary: + /* Touch a boundary, such as the end of HTTP headers, bodys, et al. */ + __action_args = hf_private_req_in->parse_cursor; + hf_private_req_in->parse_cursor = 0; + if (hf_private_req_in->stream_action == ACTION_FORWARD_DATA) { tfe_stream_action_set_opt(stream, ACTION_OPT_FOWARD_BYTES, &__action_args, sizeof(__action_args));