From 2ab9c3369b533f2acde048ef2ef785cd9030b96e Mon Sep 17 00:00:00 2001 From: Manuel Berkemeier Date: Tue, 10 May 2022 13:22:25 +0200 Subject: [PATCH] fix https://github.com/JuliaLang/Downloads.jl/issues/193 --- src/curl.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/curl.jl b/src/curl.jl index 725ca05..e82967c 100644 --- a/src/curl.jl +++ b/src/curl.jl @@ -181,7 +181,7 @@ function set_low_speed_limits(easy::Curl.Easy, low_speed_limit, low_speed_time) low_speed_time >= 0 || throw(ArgumentError("`low_speed_time` must be non-negative, got $(low_speed_time).")) - _max = Clong(typemax(Clong)) + _max = typemax(Clong) ÷ 1000 _low_speed_limit = low_speed_limit <= _max ? round(Clong, low_speed_limit) : _max _low_speed_time = low_speed_time <= _max ? round(Clong, low_speed_time) : _max @@ -197,8 +197,7 @@ function set_connect_timeout(easy::Curl.Easy, timeout::Real) timeout_ms = round(Clong, timeout * 1000) Curl.setopt(easy, CURLOPT_CONNECTTIMEOUT_MS, timeout_ms) else - timeout = timeout ≤ typemax(Clong) ? round(Clong, timeout) : Clong(0) - Curl.setopt(easy, CURLOPT_CONNECTTIMEOUT, timeout) + Curl.setopt(easy, CURLOPT_CONNECTTIMEOUT, Clong(0)) end end @@ -225,7 +224,6 @@ function grpc_request( # -- similar to `Downloads.request` # and "old" `gRPCClient.grpc_request` Curl.set_url(easy, url) - Curl.set_timeout(easy, request_timeout) Curl.set_verbose(easy, verbose) set_connect_timeout(easy, connect_timeout)