summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2020-11-17 17:31:17 +0800
committerfengweihao <[email protected]>2020-11-17 17:31:17 +0800
commit90615d8d0aa802a728977f7c75676421cb357bda (patch)
tree09ff9c86141aba324398034506a26caab06b52c4
parent1c31974b61069b22477bd227fae7ab23fb206687 (diff)
TSG-4108 修复http2 twitter打开失败
命中管控策略后,释放http2用户自定义数据
-rw-r--r--plugin/protocol/http2/src/http2_stream.cpp17
1 files 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)
{