diff options
author | Miguel Teixeira <miguel.teixeira@onfido.com> | 2021-06-11 16:49:22 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-07-29 15:53:54 +0900 |
commit | 60b02db5161625dd5f7d22d31989dd966837333c (patch) | |
tree | 16ef40804cb72084bf3b1d42daaa1a5da189916d /lib/net | |
parent | b3413914d949677fb975824b23d3e66dc0fa2fbe (diff) |
[ruby/net-http] Enforce write timeout when body_stream is used
The existing implementation of `Net::HTTP#write_timeout` relies on
`Net::BefferedIO` to trigger the `Net::WriteTimeout` error. This commit
changes `send_request_with_body_stream` to remove the optimization that
was making `Net::HTTP#write_timeout` not work when `body_stream` is
used.
Open issue:
https://bugs.ruby-lang.org/issues/17933
https://github.com/ruby/net-http/commit/a0fab1ab52
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/http/generic_request.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index 0b81243064..d6198cd624 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -202,9 +202,7 @@ class Net::HTTPGenericRequest IO.copy_stream(f, chunker) chunker.finish else - # copy_stream can sendfile() to sock.io unless we use SSL. - # If sock.io is an SSLSocket, copy_stream will hit SSL_write() - IO.copy_stream(f, sock.io) + IO.copy_stream(f, sock) end end |