diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp index 3d4df91..e36bd38 100644 --- a/plugin/protocol/http2/src/http2_stream.cpp +++ b/plugin/protocol/http2/src/http2_stream.cpp @@ -2052,10 +2052,11 @@ 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 || (flags !=0 && input_len == 1)) + if (h2_session == NULL || ((flags & NGHTTP2_FLAG_END_STREAM) && input_len == 1)) { return 0; } + resp = h2_session->resp; if (resp == NULL) { @@ -2074,8 +2075,8 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, } else { - /*if input is end_stream, send by nghttp2_submit_frame_data **/ - if (flags != NGHTTP2_FLAG_END_STREAM) + /*if input is end_stream, send by nghttp2_submit_frame_data **/ + if (flags != NGHTTP2_FLAG_END_STREAM && h2_session->plugin_built_resp == NULL) { /**Decompression failed, send this data**/ stream_action = nghttp2_submit_data_by_user(h2_stream_info, h2_session, CONN_DIR_UPSTREAM);