getting only a 100 Continue response and nothing else, when talking HTTP,
authorDaniel Stenberg <daniel@haxx.se>
Wed, 7 Apr 2004 14:27:54 +0000 (14:27 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 7 Apr 2004 14:27:54 +0000 (14:27 +0000)
is now treated as an error by libcurl

CHANGES
README
RELEASE-NOTES
docs/KNOWN_BUGS
lib/http.c
lib/transfer.c
lib/urldata.h
tests/data/Makefile.am
tests/data/test158 [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index df2d8eaecc2c5afb3ceee07599567a7682e0bf8d..c93fcccc787575158c993ced4d84ea1ac70d0334 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,13 @@
 
                                   Changelog
 
+Daniel (7 April 2004)
+- A request that sends "Expect: 100-continue" and gets nothing but a single
+  100 response back will now return a CURLE_GOT_NOTHING. Test 158 verifies.
+
+- The strtoofft() macro is now named curlx_strtoofft() to use the curlx_*
+  approach fully.
+
 Daniel (6 April 2004)
 - Gisle Vanem's fixed bug #927979 reported by Nathan O'Sullivan. The problem
   made libcurl on Windows leak a small amount of memory in each name resolve
diff --git a/README b/README
index bbd447c916d025ce284690badf701e42f25f63b4..22b18b22a03c9790f8eb1eafd87ad8a34b378591 100644 (file)
--- a/README
+++ b/README
@@ -34,6 +34,7 @@ WEB SITE
         Australia -- http://curl.planetmirror.com/
         Estonia   -- http://curl.dope-brothers.com/
         Germany   -- http://curl.mirror.at.stealer.net/
+        Germany   -- http://curl.netmirror.org/
         Russia    -- http://curl.tsuren.net/
         Thailand  -- http://curl.siamu.ac.th/
         US (CA)   -- http://curl.mirror.redwire.net/
@@ -42,15 +43,17 @@ DOWNLOAD
 
   The official download mirror sites are:
 
-        Australia -- http://curl.planetmirror.com/download/
-        Estonia   -- http://curl.dope-brothers.com/download/
+        Australia -- http://curl.planetmirror.com/download.html
+        Estonia   -- http://curl.dope-brothers.com/download.html
         Germany   -- ftp://ftp.fu-berlin.de/pub/unix/network/curl/
+        Germany   -- http://curl.mirror.at.stealer.net/download.html
+        Germany   -- http://curl.netmirror.org/download.html
         Hongkong  -- http://www.execve.net/curl/
-        Russia    -- http://curl.tsuren.net/download/
+        Russia    -- http://curl.tsuren.net/download.html
         Sweden    -- ftp://ftp.sunet.se/pub/www/utilities/curl/
         Sweden    -- http://cool.haxx.se/curl/
-        Thailand  -- http://curl.siamu.ac.th/download/
-        US (CA)   -- http://curl.mirror.redwire.net/download/
+        Thailand  -- http://curl.siamu.ac.th/download.html
+        US (CA)   -- http://curl.mirror.redwire.net/download.html
 
 CVS
 
index 089c5960fbf28397c7fd81ac61ee7c8ce5f08425..a8c224524c7ea129f403d7427571678c7d92047b 100644 (file)
@@ -13,9 +13,12 @@ This release includes the following changes:
 
 This release includes the following bugfixes:
 
+ o getting only a 100 Continue response and nothing else, when talking HTTP,
+   is now treated as an error by libcurl
  o fixed minor memory leak in libcurl for Windows when staticly linked
  o POST/PUT using Digest/NTLM/Negotiate (including anyauth) now work better
- o --limit-rate with high speed rates is a lot more accurate now
+ o --limit-rate with high speed rates is a lot more accurate now, and supports
+   limiting to speeds >2GB/sec on systems with Large File support.
  o curl_strnqual.3 "refer-to" man page fix
  o fixed a minor very old progress meter final update bug
  o added checks for a working NI_WITHSCOPEID before that is used
@@ -39,6 +42,7 @@ This release includes the following bugfixes:
 Other curl-related news since the previous public release:
 
  o PycURL 7.11.1 was released: http://pycurl.sf.net/
+ o New German web mirror: http://curl.netmirror.org/
 
 This release would not have looked like this without help, code, reports and
 advice from friends like these:
index 6f60d4022b546b8fe9b1723faf43d9b4d4da0f74..7726b225cdfb4ebdebf20e3d42028c20695a2e60 100644 (file)
@@ -23,13 +23,6 @@ may have been fixed since this was written!
   indicate that the user wants to reach the root dir (this exception SHALL
   remain even when this bug is fixed).
 
-* 1) libcurl does a POST
-  2) receives a 100-continue
-  3) sends away the POST
-  Now, if nothing else is returned from the server, libcurl MUST return
-  CURLE_GOT_NOTHING, but it seems it returns CURLE_OK as it seems to count
-  the 100-continue reply as a good enough reply.
-
 * libcurl doesn't treat the content-length of compressed data properly, as
   it seems HTTP servers send the *uncompressed* length in that header and
   libcurl thinks of it as the *compressed* lenght. Some explanations are here:
index 3c2eceff3f55fa7aff6e6d43213c48c9d9273481..32666d82b7987ac30b178991c8b77a1e7542954d 100644 (file)
@@ -1116,10 +1116,12 @@ CURLcode Curl_http_done(struct connectdata *conn)
     conn->bytecount = http->readbytecount + http->writebytecount;
 
   if(!conn->bits.retry &&
-     !(http->readbytecount + conn->headerbytecount)) {
+     ((http->readbytecount +
+       conn->headerbytecount -
+       conn->deductheadercount)) <= 0) {
     /* If this connection isn't simply closed to be retried, AND nothing was
-       read from the HTTP server, this can't be right so we return an error
-       here */
+       read from the HTTP server (that counts), this can't be right so we
+       return an error here */
     failf(data, "Empty reply from server");
     return CURLE_GOT_NOTHING;
   }
index 4d5577a05ee7732fcb2ac913519a1e42a111fe1d..4385b843de5de29cd6c83e3ede6e65f15c705bf6 100644 (file)
@@ -468,6 +468,9 @@ CURLcode Curl_readwrite(struct connectdata *conn,
               data->info.header_size += headerlen;
               conn->headerbytecount += headerlen;
 
+              conn->deductheadercount =
+                (100 == k->httpcode)?conn->headerbytecount:0;
+
               if (conn->resume_from &&
                   !k->content_range &&
                   (data->set.httpreq==HTTPREQ_GET)) {
index 4ed66243d662c1e20970b7f122ca7a5665af3a92..4f53d8412bee1c75683a9cf936a6b83bcc914f6b 100644 (file)
@@ -438,6 +438,11 @@ struct connectdata {
   char *ppath;
   curl_off_t bytecount;
   long headerbytecount;  /* only count received headers */
+  long deductheadercount; /* this amount of bytes doesn't count when we check
+                             if anything has been transfered at the end of
+                             a connection. We use this counter to make only
+                             a 100 reply (without a following second response
+                             code) result in a CURLE_GOT_NOTHING error code */
 
   char *range; /* range, if used. See README for detailed specification on
                   this syntax. */
index 46df9cb2fb0939c412426884db57cccb64eba270..cc260ab9fffe4d043d668900d46a458d3324dc3c 100644 (file)
@@ -2,28 +2,26 @@ iall:
 install:
 test:
 
-EXTRA_DIST = \
-test1    test108  test117  test127  test20   test27   test34   test46 \
-test10   test109  test118  test13   test200  test28   test36   test47 \
-test100  test11   test119  test14   test201  test29   test37   test5 \
-test101  test110  test12   test15   test202  test3    test4    test6 \
-test102  test111  test120  test16   test21   test30     test7 \
-test103  test112  test121  test17   test22   test300    test8 \
-test104  test113  test122  test18   test23   test301    test9 \
-test105  test114  test123  test19   test24   test302  test43   test31 \
-test106  test115  test124  test190  test25   test303  test44   test38 \
-test107  test116  test125  test2    test26   test33   test45   test126 \
-test304  test39   test32   test128  test48 test306 \
-test130  test131  test132  test133  test134 test135 test305 \
-test49 test50 test51 test52 test53 test54 test55 test56 \
-test500 test501 test502 test503 test504 test136 test57 test137 test138 \
-test58 test139 test140 test141 test59 test60 test61 test142 test143 \
-test62 test63 test64 test65 test66 test144 test145 test67 test68 test41 \
-test40 test42 test69 test70 test71 test72 test73 test146 test505 \
-test74 test75 test76 test77 test78 test147 test148 test506 test79 test80 \
-test81 test82 test83 test84 test85 test86 test87 test507 test149 test88 \
-test89 test90 test508 test91 test92 test203 test93 test94 test95 test509 \
-test510 test97 test98 test99 test150 test151 test152 test153
+EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
+test10 test109 test118 test13 test200 test28 test36 test47 test100     \
+test11 test119 test14 test201 test29 test37 test5 test101 test110      \
+test12 test15 test202 test3 test4 test6 test102 test111 test120 test16 \
+test21 test30 test7 test103 test112 test121 test17 test22 test300      \
+test8 test104 test113 test122 test18 test23 test301 test9 test105      \
+test114 test123 test19 test24 test302 test43 test31 test106 test115    \
+test124 test190 test25 test303 test44 test38 test107 test116 test125   \
+test2 test26 test33 test45 test126 test304 test39 test32 test128       \
+test48 test306 test130 test131 test132 test133 test134 test135 test305 \
+test49 test50 test51 test52 test53 test54 test55 test56 test500                \
+test501 test502 test503 test504 test136 test57 test137 test138 test58  \
+test139 test140 test141 test59 test60 test61 test142 test143 test62    \
+test63 test64 test65 test66 test144 test145 test67 test68 test41       \
+test40 test42 test69 test70 test71 test72 test73 test146 test505       \
+test74 test75 test76 test77 test78 test147 test148 test506 test79      \
+test80 test81 test82 test83 test84 test85 test86 test87 test507                \
+test149 test88 test89 test90 test508 test91 test92 test203 test93      \
+test94 test95 test509 test510 test97 test98 test99 test150 test151     \
+test152 test153 test154 test155 test156 test157 test158
 
 # The following tests have been removed from the dist since they no longer
 # work. We need to fix the test suite's FTPS server first, then bring them
diff --git a/tests/data/test158 b/tests/data/test158
new file mode 100644 (file)
index 0000000..95ad059
--- /dev/null
@@ -0,0 +1,49 @@
+# Server-side
+<reply>
+<data>
+HTTP/1.1 100 Continue swsclose\r
+Silly-header: yeeeees\r
+\r
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP multipart formpost with only a 100 reply
+ </name>
+ <command>
+http://%HOSTIP:%HOSTPORT/158 -F name=daniel
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+^Content-Type: multipart/form-data.*
+^---------------------------.*
+</strip>
+<protocol>
+POST /158 HTTP/1.1\r
+User-Agent: curl/7.11.2-CVS (i686-pc-linux-gnu) libcurl/7.11.2-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS\r
+Host: 127.0.0.1:8999\r
+Pragma: no-cache\r
+Accept: */*\r
+Content-Length: 145\r
+Expect: 100-continue\r
+Content-Type: multipart/form-data; boundary=----------------------------4f12fcdaa3bc\r
+\r
+------------------------------4f12fcdaa3bc\r
+Content-Disposition: form-data; name="name"\r
+\r
+daniel\r
+------------------------------4f12fcdaa3bc--\r
+</protocol>
+<errorcode>
+52
+</errorcode>
+</verify>