From: Eric Wong Date: 2017-04-04T18:00:50+00:00 Subject: [ruby-core:80564] Re: [Ruby trunk Bug#13396] Net::HTTP has no write timeout jean.boussier@gmail.com wrote: > Issue #13396 has been updated by byroot (Jean Boussier). > > > I submitted a pull request to solve this issue: https://github.com/ruby/ruby/pull/1575 Thanks, I think having a write timeout for Net::HTTP is long overdue. I'm not approved to make public API changes but would like it accepted. I would also like to add native timeout support to IO.copy_stream (or improve stdlib timeout support for safety by implementing natively). Note: I checked your commit c789ab8df5c8d6e0643ccd481f748014f0066345 by having a "fetch = +refs/pull/*:refs/remotes/ruby/pull/*" line in a "remote" section of my .git/config. I did not use any proprietary API or JavaScript to view your changes. > I tried setting `setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, ...)` on the client socket, but without success. However adding a `Timeout.timeout` call around `req.exec` did work. Under Linux, SO_SNDTIMEO won't work if the the socket was set to nonblocking which would cause Ruby to wait with ppoll (select on other platforms). Unsubscribe: