]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi: close the connection when h2=>h1 downgrading
authorDaniel Stenberg <daniel@haxx.se>
Thu, 25 Mar 2021 12:13:18 +0000 (13:13 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Mar 2021 15:18:13 +0000 (16:18 +0100)
Otherwise libcurl is likely to reuse the connection again in the next
attempt since the connection reuse logic doesn't take downgrades into
account.

Reported-by: Anthony Ramine
Fixes #6788
Closes #6793

lib/multi.c

index f5bacc17cba164949c95dbc62a608bfdf15be4fc..5de4793225028102aaa629f234801eabd73dc14d 100644 (file)
@@ -2158,6 +2158,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
 
         if(!ret) {
           infof(data, "Downgrades to HTTP/1.1!\n");
+          connclose(data->conn, "Disconnect HTTP/2 for HTTP/1");
           data->state.httpwant = CURL_HTTP_VERSION_1_1;
           /* clear the error message bit too as we ignore the one we got */
           data->state.errorbuf = FALSE;