From 85ce195f75e16d59840e3de74bc5b2846630cabd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 11 Jul 2012 23:13:52 +0200 Subject: 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 --- lib/http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index 7b0dc38d2..b421a2c73 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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 -- cgit v1.2.3