- easy.set_option(::curl::Option::timeout_ms, timeout.count());
+ // timeout.count() is a long long, but curl uses varargs and wants a long.
+ // If timeout.count() overflows a long, we wait forever instead of roughly 24.8 days.
+ auto count = timeout.count();
+ long adjusted_timeout = count <= std::numeric_limits<long>::max() ? count : 0;
+ easy.set_option(::curl::Option::timeout_ms, adjusted_timeout);
}
Here is a diff that does this:
=== modified file 'src/core/ net/http/ impl/curl/ request. h' net/http/ impl/curl/ request. h 2014-11-13 13:16:42 +0000 net/http/ impl/curl/ request. h 2015-01-23 05:16:35 +0000 state.load( ) != core::net: :http:: Request: :State: :ready) :http:: Request: :Errors: :AlreadyActive{ CORE_FROM_ HERE()} ;
--- src/core/
+++ src/core/
@@ -109,7 +109,11 @@
if (atomic_
throw core::net:
- easy.set_ option( ::curl: :Option: :timeout_ ms, timeout.count()); limits< long>:: max() ? count : 0; option( ::curl: :Option: :timeout_ ms, adjusted_timeout);
+ // timeout.count() is a long long, but curl uses varargs and wants a long.
+ // If timeout.count() overflows a long, we wait forever instead of roughly 24.8 days.
+ auto count = timeout.count();
+ long adjusted_timeout = count <= std::numeric_
+ easy.set_
}
Response execute(const Request: :ProgressHandle r& ph)