aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-06-25 13:58:14 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-06-25 13:58:14 +0000
commit974fa1242aa9e7a95c687cb1d074240c53ffb33b (patch)
tree5297e760812dfc2a28941b7ba0e2144cbc4b4124
parent3dff58b3aa14e2a6c0c3a0e35eb27da654288553 (diff)
Adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
chunked encoding (that also lacks "Connection: close"). It now simply assumes that the connection WILL be closed to signal the end, as that is how RFC2616 section 4.4 point #5 says we should behave.
-rw-r--r--CHANGES6
-rw-r--r--RELEASE-NOTES3
-rw-r--r--lib/transfer.c11
-rw-r--r--tests/data/test2822
4 files changed, 15 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index 8551439d1..506811251 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,12 @@
Changelog
+Daniel S (25 June 2007)
+- Adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
+ chunked encoding (that also lacks "Connection: close"). It now simply
+ assumes that the connection WILL be closed to signal the end, as that is how
+ RFC2616 section 4.4 point #5 says we should behave.
+
Version 7.16.3 (25 June 2007)
Daniel S (23 June 2007)
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 54e75bdeb..19ab978d3 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -15,7 +15,8 @@ This release includes the following changes:
This release includes the following bugfixes:
- o
+ o adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
+ chunked encoding
This release includes the following known bugs:
diff --git a/lib/transfer.c b/lib/transfer.c
index 703f408a2..35e8192ef 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -577,11 +577,12 @@ CURLcode Curl_readwrite(struct connectdata *conn,
(k->httpversion >= 11) )
/* On HTTP 1.1, when connection is not to get closed, but no
Content-Length nor Content-Encoding chunked have been
- received, there is no body in this response. We don't set
- stop_reading TRUE since that would also prevent necessary
- authentication actions to take place. */
- conn->bits.no_body = TRUE;
-
+ received, according to RFC2616 section 4.4 point 5, we
+ assume that the server will close the connection to
+ signal the end of the document. */
+ infof(data, "no chunk, no close, no size. Assume close to "
+ "signal end\n");
+ conn->bits.close = TRUE;
}
if (417 == k->httpcode) {
diff --git a/tests/data/test282 b/tests/data/test282
index 557e46144..aa8aba5a2 100644
--- a/tests/data/test282
+++ b/tests/data/test282
@@ -10,7 +10,7 @@ HTTP GET
# Server-side
<reply>
<data>
-HTTP/1.1 200 OK
+HTTP/1.1 200 OK swsclose
</data>
</reply>