mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 17:18:48 -05:00
http2: make sure to send after RST_STREAM
If this is the last stream on this connection, the RST_STREAM might not get pushed to the wire otherwise. Fixes #2882 Closes #2887 Researched-by: Michael Kaufmann
This commit is contained in:
parent
ba58ce669c
commit
c7ea4ddd2e
@ -1146,6 +1146,9 @@ void Curl_http2_done(struct connectdata *conn, bool premature)
|
|||||||
struct HTTP *http = data->req.protop;
|
struct HTTP *http = data->req.protop;
|
||||||
struct http_conn *httpc = &conn->proto.httpc;
|
struct http_conn *httpc = &conn->proto.httpc;
|
||||||
|
|
||||||
|
if(!httpc->h2) /* not HTTP/2 ? */
|
||||||
|
return;
|
||||||
|
|
||||||
if(data->state.drain)
|
if(data->state.drain)
|
||||||
drained_transfer(data, httpc);
|
drained_transfer(data, httpc);
|
||||||
|
|
||||||
@ -1166,8 +1169,10 @@ void Curl_http2_done(struct connectdata *conn, bool premature)
|
|||||||
|
|
||||||
if(premature) {
|
if(premature) {
|
||||||
/* RST_STREAM */
|
/* RST_STREAM */
|
||||||
nghttp2_submit_rst_stream(httpc->h2, NGHTTP2_FLAG_NONE, http->stream_id,
|
if(!nghttp2_submit_rst_stream(httpc->h2, NGHTTP2_FLAG_NONE,
|
||||||
NGHTTP2_STREAM_CLOSED);
|
http->stream_id, NGHTTP2_STREAM_CLOSED))
|
||||||
|
(void)nghttp2_session_send(httpc->h2);
|
||||||
|
|
||||||
if(http->stream_id == httpc->pause_stream_id) {
|
if(http->stream_id == httpc->pause_stream_id) {
|
||||||
infof(data, "stopped the pause stream!\n");
|
infof(data, "stopped the pause stream!\n");
|
||||||
httpc->pause_stream_id = 0;
|
httpc->pause_stream_id = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user