mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[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
a0fab1ab52
This commit is contained in:
parent
b3413914d9
commit
60b02db516
2 changed files with 29 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue