Commit 85ce195f authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

HEAD: don't force-close after response-headers

A HEAD response has no body length and gets the headers like the
corresponding GET would so it should not get closed after the response
based on the same rules. This mistake caused connections that did HEAD
to get closed too often without a valid reason.

Bug: http://curl.haxx.se/bug/view.cgi?id=3542731
Reported by: Eelco Dolstra
parent 18f8b7eb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2851,7 +2851,8 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,

        if((k->size == -1) && !k->chunk && !conn->bits.close &&
           (conn->httpversion >= 11) &&
           !(conn->handler->protocol & CURLPROTO_RTSP)) {
           !(conn->handler->protocol & CURLPROTO_RTSP) &&
           data->set.httpreq != HTTPREQ_HEAD) {
          /* On HTTP 1.1, when connection is not to get closed, but no
             Content-Length nor Content-Encoding chunked have been
             received, according to RFC2616 section 4.4 point 5, we