]> granicus.if.org Git - curl/commitdiff
- Test case 1041 (added by Daniel Fandrich April 14th) proved a bug where PUT
authorDaniel Stenberg <daniel@haxx.se>
Sun, 3 Aug 2008 22:20:58 +0000 (22:20 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 3 Aug 2008 22:20:58 +0000 (22:20 +0000)
  with -C - sent garbage in the Content-Range: header. I fixed this problem by
  making sure libcurl always sets the size of the _entire_ upload if an app
  attemps to do resumed uploads since libcurl simply cannot know the size of
  what is currently at the server end. Test 1041 is no longer disabled.

CHANGES
RELEASE-NOTES
TODO-RELEASE
lib/http.c
tests/data/DISABLED

diff --git a/CHANGES b/CHANGES
index a6ab84826fd5cf798a1f176d9980992bf9997698..92ce699e465480e5d7ddb4f34e789bf70959c353 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,14 @@
 
                                   Changelog
 
+
+Daniel Stenberg (4 Aug 2008)
+- Test case 1041 (added by Daniel Fandrich April 14th) proved a bug where PUT
+  with -C - sent garbage in the Content-Range: header. I fixed this problem by
+  making sure libcurl always sets the size of the _entire_ upload if an app
+  attemps to do resumed uploads since libcurl simply cannot know the size of
+  what is currently at the server end. Test 1041 is no longer disabled.
+
 Yang Tse (2 Aug 2008)
 - No longer test availability of the gdi32 library, nor use it for linking, even
   when we have been doing this since revision 1.47 of configure.ac 4 years and
index bf8973893f7af13476e9ec2f3c1eb0f1f2d5c395..7c31bc50eff838d5d365637c4e63c90d56238440 100644 (file)
@@ -45,6 +45,7 @@ This release includes the following bugfixes:
  o a user name in a proxy URL without a password was parsed incorrectly
  o library will now be built with _REENTRANT symbol defined only if needed
  o no longer link with gdi32 on Windows cross-compiled targets
+ o PUT with -C - sent bad Content-Range: header
 
 This release includes the following known bugs:
 
index b0d5470966623e4bae14adf581507ef38905bcab..25618efc9bf994f3f5fa480f19a05a0617887d8e 100644 (file)
@@ -25,8 +25,6 @@ To be addressed before 7.19.0 (planned release: August 2008)
          tests on the system might allow determination of the problem origin.
          Solaris AutoBuilds suceeded on August 2 and 3.
 
-150 - PUT with -C - sends garbage in the Content-Range: header (test case 1041)
-
 151 - PUT with -L hangs after receiving a redirect (test case 1051, but the
       test harness has a problem with this, too)
 
index 0da7156e30b3e83e82606d995158adb427e67401..195d661d6a5cc65e8d0d8142219cdff10c84a751 100644 (file)
@@ -2363,7 +2363,17 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
       if(conn->allocptr.rangeline)
         free(conn->allocptr.rangeline);
 
-      if(data->state.resume_from) {
+      if(data->set.set_resume_from < 0) {
+        /* Upload resume was asked for, but we don't know the size of the
+           remote part so we tell the server (and act accordingly) that we
+           upload the whole file (again) */
+        conn->allocptr.rangeline =
+          aprintf("Content-Range: bytes 0-%" FORMAT_OFF_T
+                  "/%" FORMAT_OFF_T "\r\n",
+                  data->set.infilesize - 1, data->set.infilesize);
+
+      }
+      else if(data->state.resume_from) {
         /* This is because "resume" was selected */
         curl_off_t total_expected_size=
           data->state.resume_from + data->set.infilesize;
index 4b41d668a1193916a922a7844f8db7c15f071aa0..33f2c8d6eebbc6bd5852b8e285756c58029aab46 100644 (file)
@@ -3,7 +3,6 @@
 # test cases are run by runtests.pl. Just add the plain test case numbers, one
 # per line.
 # Lines starting with '#' letters are treated as comments.
-1041
 1051
 1052
 1055