diff options
author | Bryan Ischo <bryan@ischo.com> | 2008-07-29 03:45:19 +0000 |
---|---|---|
committer | Bryan Ischo <bryan@ischo.com> | 2008-07-29 03:45:19 +0000 |
commit | 4f06cb3efa814b0bd6f2c5221137bf546c79159a (patch) | |
tree | dc040508c5c580002117b2f73386c6754d8f5528 /src | |
parent | bb6881fd260bebf017780c46bc0cd67921e33d79 (diff) | |
download | ceph-libs3-4f06cb3efa814b0bd6f2c5221137bf546c79159a.tar.gz |
* Workaround for buggy libcurl nonsupport for large files
* Improved libs3.h comments
Diffstat (limited to 'src')
-rw-r--r-- | src/request.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/request.c b/src/request.c index 9dd2582..8ff33f1 100644 --- a/src/request.c +++ b/src/request.c @@ -796,11 +796,6 @@ static S3Status setup_curl(Request *request, // Set read callback, data, and readSize curl_easy_setopt_safe(CURLOPT_READFUNCTION, &curl_read_func); curl_easy_setopt_safe(CURLOPT_READDATA, request); - // xxx the following does not work in some versions of CURL. - // CURL is retarded in how it defines large offsets, using only - // 32 bits sometimes, when it should always use 64 via int64_t - curl_easy_setopt_safe(CURLOPT_INFILESIZE_LARGE, - params->toS3CallbackTotalSize); // Set write callback and data curl_easy_setopt_safe(CURLOPT_WRITEFUNCTION, &curl_write_func); @@ -854,6 +849,16 @@ static S3Status setup_curl(Request *request, values-> fieldName); \ } + // Would use CURLOPT_INFILESIZE_LARGE, but it is buggy in libcurl + if (params->httpRequestType == HttpRequestTypePUT) { + char header[256]; + snprintf(header, sizeof(header), "Content-Length: %llu", + params->toS3CallbackTotalSize); + request->headers = curl_slist_append(request->headers, header); + request->headers = curl_slist_append(request->headers, + "Transfer-Encoding:"); + } + append_standard_header(cacheControlHeader); append_standard_header(contentTypeHeader); append_standard_header(md5Header); |