mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:23:39 +03:00
http2: avoid too early connection re-use/multiplexing
HTTP/1 connections that are upgraded to HTTP/2 should not be picked up for reuse and multiplexing by other handles until the 101 switching process is completed. Lots-of-debgging-by: Stefan Eissing Reported-by: Richard W.M. Jones Bug: https://curl.se/mail/lib-2023-07/0045.html Closes #11557
This commit is contained in:
parent
15c40a32b7
commit
d4618a3fc4
5 changed files with 42 additions and 20 deletions
|
|
@ -4058,6 +4058,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||
/* Switching Protocols */
|
||||
if(k->upgr101 == UPGR101_H2) {
|
||||
/* Switching to HTTP/2 */
|
||||
DEBUGASSERT(conn->httpversion < 20);
|
||||
infof(data, "Received 101, Switching to HTTP/2");
|
||||
k->upgr101 = UPGR101_RECEIVED;
|
||||
|
||||
|
|
@ -4100,6 +4101,11 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(k->upgr101 == UPGR101_H2) {
|
||||
/* A requested upgrade was denied, poke the multi handle to possibly
|
||||
allow a pending pipewait to continue */
|
||||
Curl_multi_connchanged(data->multi);
|
||||
}
|
||||
k->header = FALSE; /* no more header to parse! */
|
||||
|
||||
if((k->size == -1) && !k->chunk && !conn->bits.close &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue