Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbb-upb committed May 10, 2022
1 parent 3a1bb06 commit 2ab9c33
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/curl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 2ab9c33

Please sign in to comment.