From 65ca1cf6793cd032e549ac312c08e1e50869b96d Mon Sep 17 00:00:00 2001 From: fengweihao Date: Mon, 14 Dec 2020 11:52:47 +0800 Subject: TSG-4606 重置HTTP2应答头上下文 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/protocol/http2/src/http2_stream.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'plugin/protocol/http2/src/http2_stream.cpp') diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp index fc404f2..e24b9c3 100644 --- a/plugin/protocol/http2/src/http2_stream.cpp +++ b/plugin/protocol/http2/src/http2_stream.cpp @@ -2104,7 +2104,7 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, resp->event_cb(resp, EV_HTTP_RESP_BODY_BEGIN, NULL, len, resp->event_cb_user); } - if (flags == NGHTTP2_FLAG_END_STREAM) + if (flags & NGHTTP2_FLAG_END_STREAM) { resp->h2_payload.flags = NGHTTP2_FLAG_NONE; }else @@ -2120,7 +2120,7 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, resp->event_cb(resp, EV_HTTP_RESP_BODY_CONT, data, len, resp->event_cb_user); } - if (flags == NGHTTP2_FLAG_END_STREAM) + if (flags & NGHTTP2_FLAG_END_STREAM) { resp->h2_payload.flags = NGHTTP2_FLAG_NONE; }else @@ -2191,6 +2191,7 @@ create_upstream_data(nghttp2_session *session, int32_t stream_id, goto resp; } if (h2_session->resp){ + nghttp2_session_set_stream_user_data(session, stream_id, h2_session); /** todo:When the data of the reply is pushed as promised, there is no stream id at the reply end. to create it*/ goto finish; @@ -2447,7 +2448,7 @@ nghttp2_server_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, req->event_cb(req, EV_HTTP_REQ_BODY_BEGIN, NULL, len, req->event_cb_user); } - if (flags == NGHTTP2_FLAG_END_STREAM) + if (flags & NGHTTP2_FLAG_END_STREAM) { req->h2_payload.flags = NGHTTP2_FLAG_NONE; }else @@ -2463,7 +2464,7 @@ nghttp2_server_on_data_chunk_recv(nghttp2_session *session, uint8_t flags, req->event_cb(req, EV_HTTP_REQ_BODY_CONT, data, len, req->event_cb_user); } - if (flags == NGHTTP2_FLAG_END_STREAM){ + if (flags & NGHTTP2_FLAG_END_STREAM){ req->h2_payload.flags = NGHTTP2_FLAG_NONE; }else{ req->h2_payload.flags = flags; -- cgit v1.2.3