aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-10-06 06:28:39 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-10-06 06:28:39 +0000
commit03a56b3e56f8200c479f3786b54dc458b148f667 (patch)
treeb99cbce86f059275f8e7e56c769388d1c2fdcffc /lib/url.c
parent18f67852be77951b9d559240d382a223223666e4 (diff)
HTTP resume fix, now the range pointer may be allocated
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index 582d03da0..3865d201e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -183,6 +183,11 @@ void static urlfree(struct UrlData *data, bool totally)
switch off that knowledge again... */
data->bits.httpproxy=FALSE;
}
+
+ if(data->bits.rangestringalloc) {
+ free(data->range);
+ data->range=NULL;
+ }
if(data->ptr_proxyuserpwd) {
free(data->ptr_proxyuserpwd);
@@ -906,7 +911,8 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
if(!data->bits.set_range) {
/* if it already was in use, we just skip this */
sprintf(resumerange, "%d-", data->resume_from);
- data->range=resumerange; /* tell ourselves to fetch this range */
+ data->range=strdup(resumerange); /* tell ourselves to fetch this range */
+ data->bits.rangestringalloc = TRUE; /* mark as allocated */
data->bits.set_range = 1; /* switch on range usage */
}
}