From b60e0fa97ed7ddc66d0ad6d00dfd78319bb6ad36 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Jan 2004 22:29:29 +0000 Subject: David J Meyer's large file support. --- lib/url.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'lib/url.c') 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); -- cgit v1.2.3