Skip to content
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

Revert readtimeout back to 0 by default; connect_timeout to 10 #994

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ConnectionPool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ function getconnection(::Type{TCPSocket},
# alive in the face of heavy workloads where Julia's task scheduler might take a while to
# keep up with midflight requests
keepalive::Bool=true,
connect_timeout::Int=60,
readtimeout::Int=60,
connect_timeout::Int=10,
readtimeout::Int=0,
kw...)::TCPSocket

p::UInt = isempty(port) ? UInt(80) : parse(UInt, port)
Expand Down Expand Up @@ -539,7 +539,7 @@ end
function sslupgrade(::Type{IOType}, c::Connection,
host::AbstractString;
require_ssl_verification::Bool=NetworkOptions.verify_host(host, "SSL"),
readtimeout::Int=60,
readtimeout::Int=0,
kw...)::Connection{IOType} where {IOType}
# initiate the upgrade to SSL
# if the upgrade fails, an error will be thrown and the original c will be closed
Expand Down
4 changes: 2 additions & 2 deletions src/HTTP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ Supported optional keyword arguments:
will be written to this stream instead of returned as a `Vector{UInt8}`.
- `verbose = 0`, set to `1` or `2` for increasingly verbose logging of the
request and response process
- `connect_timeout = 60`, close the connection after this many seconds if it
- `connect_timeout = 10`, close the connection after this many seconds if it
is still attempting to connect. Use `connect_timeout = 0` to disable.
- `connection_limit = 8`, number of concurrent connections allowed to each host:port.
- `readtimeout = 60`, close the connection if no data is received for this many
- `readtimeout = 0`, close the connection if no data is received for this many
seconds. Use `readtimeout = 0` to disable.
- `status_exception = true`, throw `HTTP.StatusError` for response status >= 300.
- Basic authentication is detected automatically from the provided url's `userinfo` (in the form `scheme://user:password@host`)
Expand Down
2 changes: 1 addition & 1 deletion src/clientlayers/ConnectionRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Close the connection if the request throws an exception.
Otherwise leave it open so that it can be reused.
"""
function connectionlayer(handler)
return function(req; proxy=getproxy(req.url.scheme, req.url.host), socket_type::Type=TCPSocket, socket_type_tls::Type=SOCKET_TYPE_TLS[], readtimeout::Int=60, kw...)
return function(req; proxy=getproxy(req.url.scheme, req.url.host), socket_type::Type=TCPSocket, socket_type_tls::Type=SOCKET_TYPE_TLS[], readtimeout::Int=0, kw...)
local io, stream
if proxy !== nothing
target_url = req.url
Expand Down
2 changes: 1 addition & 1 deletion src/clientlayers/TimeoutRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export timeoutlayer
Close the `HTTP.Stream` if no data has been received for `readtimeout` seconds.
"""
function timeoutlayer(handler)
return function(stream::Stream; readtimeout::Int=60, kw...)
return function(stream::Stream; readtimeout::Int=0, kw...)
if readtimeout <= 0
# skip
return handler(stream; kw...)
Expand Down