aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-01-05 22:29:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-01-05 22:29:29 +0000
commitb60e0fa97ed7ddc66d0ad6d00dfd78319bb6ad36 (patch)
tree50a5aed5fe1754b59f331e8c4337c8301121e1c7 /lib/url.c
parent41c6f68d949bf6021fbf4d3488bbf38efa898816 (diff)
David J Meyer's large file support.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index cd8ce5fdd..a01eab0b1 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -711,6 +711,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
*/
data->set.infilesize = va_arg(param, long);
break;
+ case CURLOPT_INFILESIZE_LARGE:
+ /*
+ * If known, this should inform curl about the file size of the
+ * to-be-uploaded file.
+ */
+ data->set.infilesize = va_arg(param, off_t);
+ break;
case CURLOPT_LOW_SPEED_LIMIT:
/*
* The low speed limit that if transfers are below this for
@@ -955,6 +962,12 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
*/
data->set.set_resume_from = va_arg(param, long);
break;
+ case CURLOPT_RESUME_FROM_LARGE:
+ /*
+ * Resume transfer at the give file position
+ */
+ data->set.set_resume_from = va_arg(param, off_t);
+ break;
case CURLOPT_DEBUGFUNCTION:
/*
* stderr write callback.
@@ -1262,6 +1275,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
data->set.ip_version = va_arg(param, long);
break;
+ case CURLOPT_MAXFILESIZE_LARGE:
+ /*
+ * Set the maximum size of a file to download.
+ */
+ data->set.max_filesize = va_arg(param, off_t);
+ break;
+
default:
/* unknown tag and its companion, just ignore: */
return CURLE_FAILED_INIT; /* correct this */
@@ -2348,7 +2368,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
if(conn->resume_from) {
if(!conn->bits.use_range) {
/* if it already was in use, we just skip this */
- snprintf(resumerange, sizeof(resumerange), "%d-", conn->resume_from);
+ snprintf(resumerange, sizeof(resumerange), "%Od-",
+ conn->resume_from);
conn->range=strdup(resumerange); /* tell ourselves to fetch this range */
conn->bits.rangestringalloc = TRUE; /* mark as allocated */
conn->bits.use_range = 1; /* switch on range usage */
@@ -2869,7 +2890,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
*/
conn->resume_from = data->set.set_resume_from;
if (conn->resume_from) {
- snprintf(resumerange, sizeof(resumerange), "%d-", conn->resume_from);
+ snprintf(resumerange, sizeof(resumerange), "%Od-",
+ conn->resume_from);
if (conn->bits.rangestringalloc == TRUE)
free(conn->range);