aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-08-17 20:21:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-08-17 20:21:32 +0000
commit5a79532aee07ddd423b7038be53a6353468134af (patch)
treed5e728dfa8a455814e1d8b20325e80f3563a08e6 /lib
parent29ac001aa64a2c9058433da39febe9da40cb884a (diff)
Song Ma provided a patch that cures a problem libcurl has when doing resume
HTTP PUT using Digest authentication. Test case 5320 and 5322 were also added to verify the functionality.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/http.c b/lib/http.c
index d22c591f9..e72ed43e1 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1993,7 +1993,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
data->reqdata.resume_from = 0;
}
- if(data->reqdata.resume_from) {
+ if(data->reqdata.resume_from && !data->state.this_is_a_follow) {
/* do we still game? */
curl_off_t passed=0;
@@ -2049,6 +2049,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
else if((httpreq != HTTPREQ_GET) &&
!checkheaders(data, "Content-Range:")) {
+ /* if a line like this was already allocated, free the previous one */
+ if(conn->allocptr.rangeline)
+ free(conn->allocptr.rangeline);
+
if(data->reqdata.resume_from) {
/* This is because "resume" was selected */
curl_off_t total_expected_size=
@@ -2066,6 +2070,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
aprintf("Content-Range: bytes %s/%" FORMAT_OFF_T "\r\n",
data->reqdata.range, data->set.infilesize);
}
+ if(!conn->allocptr.rangeline)
+ return CURLE_OUT_OF_MEMORY;
}
}
@@ -2185,11 +2191,11 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if(data->set.timecondition) {
struct tm *tm;
- /* Phil Karn (Fri, 13 Apr 2001) pointed out that the If-Modified-Since
- * header family should have their times set in GMT as RFC2616 defines:
- * "All HTTP date/time stamps MUST be represented in Greenwich Mean Time
- * (GMT), without exception. For the purposes of HTTP, GMT is exactly
- * equal to UTC (Coordinated Universal Time)." (see page 20 of RFC2616).
+ /* The If-Modified-Since header family should have their times set in
+ * GMT as RFC2616 defines: "All HTTP date/time stamps MUST be
+ * represented in Greenwich Mean Time (GMT), without exception. For the
+ * purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal
+ * Time)." (see page 20 of RFC2616).
*/
#ifdef HAVE_GMTIME_R