aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-08-03 22:20:58 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-08-03 22:20:58 +0000
commit8d012181b01aae80b46c90755a55126bc9731f7d (patch)
treea2c527bf77818ef1e0f4f65049b3f19eb28a0a95
parentd6344d9b5f752823da2cb981e974018e452bd4ab (diff)
- 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.
-rw-r--r--CHANGES8
-rw-r--r--RELEASE-NOTES1
-rw-r--r--TODO-RELEASE2
-rw-r--r--lib/http.c12
-rw-r--r--tests/data/DISABLED1
5 files changed, 20 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index a6ab84826..92ce699e4 100644
--- 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
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index bf8973893..7c31bc50e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -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:
diff --git a/TODO-RELEASE b/TODO-RELEASE
index b0d547096..25618efc9 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -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)
diff --git a/lib/http.c b/lib/http.c
index 0da7156e3..195d661d6 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -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;
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
index 4b41d668a..33f2c8d6e 100644
--- a/tests/data/DISABLED
+++ b/tests/data/DISABLED
@@ -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