]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: empty reply connection are not left intact
authorDaniel Stenberg <daniel@haxx.se>
Thu, 21 Jan 2021 06:58:36 +0000 (07:58 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 21 Jan 2021 15:39:35 +0000 (16:39 +0100)
... so mark the connection as closed in this condition to prevent that
verbose message to wrongly appear.

Reported-by: Matt Holt
Bug: https://twitter.com/mholt6/status/1352130240265375744
Closes #6503

lib/http.c

index 055103430f8e7cc5fa24c94906809f4b5e7b5b5d..471efe3d3d692efa029d1c665e4c76b36bcf9846 100644 (file)
@@ -1596,6 +1596,8 @@ CURLcode Curl_http_done(struct Curl_easy *data,
        read from the HTTP server (that counts), this can't be right so we
        return an error here */
     failf(data, "Empty reply from server");
+    /* Mark it as closed to avoid the "left intact" message */
+    streamclose(conn, "Empty reply from server");
     return CURLE_GOT_NOTHING;
   }