diff options
author | dartraiden <wowemuh@gmail.com> | 2021-05-26 22:25:25 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2021-05-26 22:26:43 +0300 |
commit | 43f100ad4b599dbc564f9920e63afdc242f0a27c (patch) | |
tree | fc63fd04b0dbb0a3b1e59a10a1f9e2217388aeb4 /libs/libcurl/src/file.c | |
parent | 7d4ed0164a32a3667fb3786fb538fc083153883a (diff) |
libcurl: update to 7.77
Diffstat (limited to 'libs/libcurl/src/file.c')
-rw-r--r-- | libs/libcurl/src/file.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/libcurl/src/file.c b/libs/libcurl/src/file.c index 1d174e519e..0420db3454 100644 --- a/libs/libcurl/src/file.c +++ b/libs/libcurl/src/file.c @@ -111,6 +111,7 @@ const struct Curl_handler Curl_handler_file = { file_disconnect, /* disconnect */ ZERO_NULL, /* readwrite */ ZERO_NULL, /* connection_check */ + ZERO_NULL, /* attach connection */ 0, /* defport */ CURLPROTO_FILE, /* protocol */ CURLPROTO_FILE, /* family */ @@ -410,16 +411,18 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) struct tm buffer; const struct tm *tm = &buffer; char header[80]; + int headerlen; + char accept_ranges[24]= { "Accept-ranges: bytes\r\n" }; if(expected_size >= 0) { - msnprintf(header, sizeof(header), + headerlen = msnprintf(header, sizeof(header), "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size); - result = Curl_client_write(data, CLIENTWRITE_HEADER, header, 0); + result = Curl_client_write(data, CLIENTWRITE_HEADER, header, headerlen); if(result) return result; result = Curl_client_write(data, CLIENTWRITE_HEADER, - (char *)"Accept-ranges: bytes\r\n", 0); + accept_ranges, strlen(accept_ranges)); if(result != CURLE_OK) return result; } @@ -430,7 +433,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) return result; /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */ - msnprintf(header, sizeof(header), + headerlen = msnprintf(header, sizeof(header), "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n%s", Curl_wkday[tm->tm_wday?tm->tm_wday-1:6], tm->tm_mday, @@ -440,7 +443,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) tm->tm_min, tm->tm_sec, data->set.opt_no_body ? "": "\r\n"); - result = Curl_client_write(data, CLIENTWRITE_HEADER, header, 0); + result = Curl_client_write(data, CLIENTWRITE_HEADER, header, headerlen); if(result) return result; /* set the file size to make it available post transfer */ |