TSG-4108 修复http2 twitter打开失败

命中管控策略后,释放http2用户自定义数据
This commit is contained in:
fengweihao
2020-11-17 17:31:17 +08:00
parent 1c31974b61
commit 90615d8d0a

View File

@@ -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->req, body_flag, CONN_DIR_DOWNSTREAM);
delete_stream_half_data(&h2_session->resp, body_flag, CONN_DIR_UPSTREAM); 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) 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*/ /*proc build resp*/
/*when input_len == 1 is end_stream, Nghttp2 sends this frame, drop it*/ /*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); 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; return 0;
} }
@@ -2076,6 +2080,10 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
TFE_LOG_ERROR(logger()->handle, "Fatal upstream(%d) send error: %s\n",stream_id, nghttp2_strerror(xret)); 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; h2_stream_info->stream_action = stream_action;
return 0; return 0;
} }
@@ -2115,7 +2123,10 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
resp->h2_payload.flags = 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); stream_action = nghttp2_submit_data_by_h2_half(h2_stream_info, h2_session, CONN_DIR_UPSTREAM);
if (stream_action == ACTION_DROP_DATA) if (stream_action == ACTION_DROP_DATA)
{ {