]> granicus.if.org Git - curl/commitdiff
Adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
authorDaniel Stenberg <daniel@haxx.se>
Mon, 25 Jun 2007 13:58:14 +0000 (13:58 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 25 Jun 2007 13:58:14 +0000 (13:58 +0000)
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.

CHANGES
RELEASE-NOTES
lib/transfer.c
tests/data/test282

diff --git a/CHANGES b/CHANGES
index 8551439d1afb9e22b8097bf233d3d097724f74bc..50681125161965554fb179523f1365a9d4e1b9ad 100644 (file)
--- 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)
index 54e75bdeb697f00365793a5855ecb63f45354c37..19ab978d3140061c6b7ba7e2a6c99d1f5b9e27a7 100644 (file)
@@ -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:
 
index 703f408a2c00b1fba206998cc4e943fdbae0ae95..35e8192efb52d6dda6404de69bce8fe4b7f67b47 100644 (file)
@@ -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) {
index 557e461440f43d45bbd5ad6260e3d21d7ce9ba58..aa8aba5a2ca67f2f23e6105d17f780e9b78bdfb7 100644 (file)
@@ -10,7 +10,7 @@ HTTP GET
 # Server-side
 <reply>
 <data>
-HTTP/1.1 200 OK
+HTTP/1.1 200 OK swsclose
 
 </data>
 </reply>