Commit da610cb6 authored by Paweł Wegner's avatar Paweł Wegner
Browse files

IHttp: Content-Length is uint64_t.

parent 516991c1
......@@ -35,7 +35,7 @@ class IHttpRequest {
public:
struct Response {
int http_code_;
int content_length_;
uint64_t content_length_;
std::shared_ptr<std::ostream> output_stream_;
std::shared_ptr<std::ostream> error_stream_;
};
......
......@@ -136,7 +136,7 @@ void CurlHttp::Worker::add(RequestData::Pointer r) {
void RequestData::done(int code) {
int ret = IHttpRequest::Unknown;
int content_length = 0;
uint64_t content_length = 0;
if (code == CURLE_OK) {
long http_code = static_cast<long>(IHttpRequest::Unknown);
curl_easy_getinfo(handle_.get(), CURLINFO_RESPONSE_CODE, &http_code);
......@@ -150,7 +150,7 @@ void RequestData::done(int code) {
double curl_content_length;
curl_easy_getinfo(handle_.get(), CURLINFO_CONTENT_LENGTH_DOWNLOAD,
&curl_content_length);
content_length = (int)(curl_content_length + 0.5);
content_length = (uint64_t)(curl_content_length + 0.5);
} else {
*error_stream_ << curl_easy_strerror(static_cast<CURLcode>(code));
ret = (code == CURLE_ABORTED_BY_CALLBACK) ? IHttpRequest::Aborted : -code;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment