mirror of
https://github.com/curl/curl.git
synced 2024-12-27 06:59:43 +08:00
http2: treat initial SETTINGS as a WINDOW_UPDATE
- refs #11426 where spurious stalls on large POST requests are reported - the issue seems to involve the following * first stream on connection adds up to 64KB of POST data, which is the max default HTTP/2 stream window size transfer is set to HOLD * initial SETTINGS from server arrive, enlarging the stream window. But no WINDOW_UPDATE is received. * curl stalls - the fix un-HOLDs a stream on receiving SETTINGS, not relying on a WINDOW_UPDATE from lazy servers Closes #11450
This commit is contained in:
parent
0d59aea93f
commit
380fe02cf5
15
lib/http2.c
15
lib/http2.c
@ -1122,6 +1122,21 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
|
|||||||
ctx->max_concurrent_streams));
|
ctx->max_concurrent_streams));
|
||||||
multi_connchanged(data->multi);
|
multi_connchanged(data->multi);
|
||||||
}
|
}
|
||||||
|
/* Since the initial stream window is 64K, a request might be on HOLD,
|
||||||
|
* due to exhaustion. The (initial) SETTINGS may announce a much larger
|
||||||
|
* window and *assume* that we treat this like a WINDOW_UPDATE. Some
|
||||||
|
* servers send an explicit WINDOW_UPDATE, but not all seem to do that.
|
||||||
|
* To be safe, we UNHOLD a stream in order not to stall. */
|
||||||
|
if((data->req.keepon & KEEP_SEND_HOLD) &&
|
||||||
|
(data->req.keepon & KEEP_SEND)) {
|
||||||
|
struct stream_ctx *stream = H2_STREAM_CTX(data);
|
||||||
|
data->req.keepon &= ~KEEP_SEND_HOLD;
|
||||||
|
if(stream) {
|
||||||
|
drain_stream(cf, data, stream);
|
||||||
|
DEBUGF(LOG_CF(data, cf, "[h2sid=%d] un-holding after SETTINGS",
|
||||||
|
stream_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NGHTTP2_GOAWAY:
|
case NGHTTP2_GOAWAY:
|
||||||
|
Loading…
Reference in New Issue
Block a user