From 90615d8d0aa802a728977f7c75676421cb357bda Mon Sep 17 00:00:00 2001 From: fengweihao Date: Tue, 17 Nov 2020 17:31:17 +0800 Subject: [PATCH] =?UTF-8?q?TSG-4108=20=E4=BF=AE=E5=A4=8Dhttp2=20twitter?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=A4=B1=E8=B4=A5=20=E5=91=BD=E4=B8=AD?= =?UTF-8?q?=E7=AE=A1=E6=8E=A7=E7=AD=96=E7=95=A5=E5=90=8E=EF=BC=8C=E9=87=8A?= =?UTF-8?q?=E6=94=BEhttp2=E7=94=A8=E6=88=B7=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/protocol/http2/src/http2_stream.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp index 96a97b3..c63c5ff 100644 --- a/plugin/protocol/http2/src/http2_stream.cpp +++ b/plugin/protocol/http2/src/http2_stream.cpp @@ -1042,6 +1042,10 @@ void delete_http2_stream_data(struct tfe_h2_session *h2_session, delete_stream_half_data(&h2_session->req, body_flag, CONN_DIR_DOWNSTREAM); delete_stream_half_data(&h2_session->resp, body_flag, CONN_DIR_UPSTREAM); + + delete_stream_half_data(&h2_session->plugin_built_req, body_flag, CONN_DIR_DOWNSTREAM); + + delete_stream_half_data(&h2_session->plugin_built_resp, body_flag, CONN_DIR_UPSTREAM); } void nghttp2_disect_goaway(struct tfe_h2_stream *h2_stream_info) @@ -2040,7 +2044,7 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, /*proc build resp*/ /*when input_len == 1 is end_stream, Nghttp2 sends this frame, drop it*/ struct tfe_h2_session *h2_session = (struct tfe_h2_session *)nghttp2_session_get_stream_user_data(session, stream_id); - if (h2_session == NULL || input_len == 1) + if (h2_session == NULL ) { return 0; } @@ -2075,7 +2079,11 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, stream_action = ACTION_FORWARD_DATA; TFE_LOG_ERROR(logger()->handle, "Fatal upstream(%d) send error: %s\n",stream_id, nghttp2_strerror(xret)); } - } + } + if(uncompr) + { + FREE(&uncompr); + } h2_stream_info->stream_action = stream_action; return 0; } @@ -2115,7 +2123,10 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, resp->h2_payload.flags = flags; } } - if (uncompr_len) FREE(&uncompr); + if (uncompr_len) + { + FREE(&uncompr); + } stream_action = nghttp2_submit_data_by_h2_half(h2_stream_info, h2_session, CONN_DIR_UPSTREAM); if (stream_action == ACTION_DROP_DATA) {