diff --git a/Project.toml b/Project.toml index 7e23a25..3e88663 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "gRPCClient" uuid = "aaca4a50-36af-4a1d-b878-4c443f2061ad" authors = ["Tanmay K.M. "] -version = "0.1.3" +version = "0.1.4" [deps] Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6" diff --git a/src/curl.jl b/src/curl.jl index 06b92a5..6d13af0 100644 --- a/src/curl.jl +++ b/src/curl.jl @@ -215,8 +215,9 @@ function recv_data(easy::Curl.Easy, output::Channel{T}, max_recv_message_length: end function set_connect_timeout(easy::Curl.Easy, timeout::Real) - (0 ≤ timeout ≤ (typemax(Clong) ÷ 1000)) || - throw(ArgumentError("timeout must be positive, got $timeout")) + maxval = typemax(Clong) ÷ 1000 + (0 ≤ timeout ≤ maxval) || + throw(ArgumentError("timeout value must be between 0 and $maxval, got $timeout")) timeout_ms = round(Clong, timeout * 1000) Curl.setopt(easy, CURLOPT_CONNECTTIMEOUT_MS, timeout_ms) end