aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-07-11 23:13:52 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-07-12 00:08:37 +0200
commit85ce195f75e16d59840e3de74bc5b2846630cabd (patch)
tree6e85f80ea9341f6c723f62d8d157ff7652eadb18
parent18f8b7eb72148cac9f318a111b4e655c213105da (diff)
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
-rw-r--r--lib/http.c3
1 files changed, 2 insertions, 1 deletions
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