Skip to content

Commit

Permalink
Clong(typemax(...) for windows?
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbb-upb committed May 9, 2022
1 parent 5a75112 commit 3a1bb06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{
"julia.environmentPath": "/home/manuelbb/.julia/dev/gRPCClient"
}
10 changes: 5 additions & 5 deletions src/curl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ 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 = typemax(Clong)
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
_max = Clong(typemax(Clong))
_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

Curl.setopt(easy, CURLOPT_LOW_SPEED_LIMIT, low_speed_limit)
Curl.setopt(easy, CURLOPT_LOW_SPEED_TIME, low_speed_time)
Curl.setopt(easy, CURLOPT_LOW_SPEED_LIMIT, _low_speed_limit)
Curl.setopt(easy, CURLOPT_LOW_SPEED_TIME, _low_speed_time)
return nothing
end

Expand Down

0 comments on commit 3a1bb06

Please sign in to comment.