From 629a23fb1f956a1464c748f878f8dd6bff50731a Mon Sep 17 00:00:00 2001 From: tan Date: Wed, 20 Jul 2022 18:43:23 +0530 Subject: [PATCH] fix error message, bump patch version Fixed error message for connect timeout validation. Bumped patch version for tagging --- Project.toml | 2 +- src/curl.jl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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