summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2020-12-14 11:52:47 +0800
committer卢文朋 <[email protected]>2020-12-15 12:22:40 +0800
commit65ca1cf6793cd032e549ac312c08e1e50869b96d (patch)
treecfbd189baff6bdef1e26ea7bdde3d2379b6baf12
parent5bf7f2f29806ff808a5a6b52efa06fda6c3c4b86 (diff)
TSG-4606 重置HTTP2应答头上下文
-rw-r--r--plugin/protocol/http2/src/http2_stream.cpp9
1 files changed, 5 insertions, 4 deletions
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;