-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't allow values just below typemax(Clong)
in set_timeout
#193
Comments
manuelbb-upb
added a commit
to manuelbb-upb/gRPCClient.jl
that referenced
this issue
May 10, 2022
manuelbb-upb
added a commit
to manuelbb-upb/gRPCClient.jl
that referenced
this issue
May 10, 2022
Thanks for the detailed bug report! I'll take a look. |
tanmaykm
added a commit
to JuliaComputing/gRPCClient.jl
that referenced
this issue
Jul 20, 2022
This adds an upper limit to the connect timeout value that can be specified, to limit it to `typemax(Clong) ÷ 1000`. An `ArgumentError` is thrown if the value is out of range. This matches what libcurl expects [here](https://github.com/curl/curl/blob/4a8f6869db3a4ba7cd1bcb153c3d5b4298728afa/lib/setopt.c#L1376). Originally reported at JuliaLang/Downloads.jl#193 and #23.
tanmaykm
added a commit
to JuliaComputing/gRPCClient.jl
that referenced
this issue
Jul 20, 2022
This adds an upper limit to the connect timeout value that can be specified, to limit it to `typemax(Clong) ÷ 1000`. An `ArgumentError` is thrown if the value is out of range. This matches what libcurl expects [here](https://github.com/curl/curl/blob/4a8f6869db3a4ba7cd1bcb153c3d5b4298728afa/lib/setopt.c#L1376). Originally reported at JuliaLang/Downloads.jl#193 and #23.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
set_timeout
function in src/Curl/Easy.jl checks the argumenttimeout
againsttypemax(Clong)
.But (at least in my case)
setopt(easy, CURLOPT_TIMEOUT, typemax(Clong))
leads towhich is a
CURL_BAD_FUNCTION_ARGUMENT
.From the C Code I would guess that checking against
typemax(Clong) ÷ 1000
is more appropriate.Simply plugging that in gives:
But the second conditional is redundant and the above is equivalent to
The text was updated successfully, but these errors were encountered: