mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fixup! * lib/net/http.rb (connect): detect closed connection and reconnect If the server closes a keep-alive http connection, the client socket reaches EOF. To avoid an EOFError, detect the closed connection and reconnect. Added test to ensure HTTP#post succeeds even if the keep-alive-connection has been closed by the server. by Kristian Hanekamp <kris.hanekamp@gmail.com> https://github.com/ruby/ruby/pull/1089 fix GH-1089
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
36326ceb22
commit
dab944e319
1 changed files with 1 additions and 1 deletions
|
@ -1478,7 +1478,7 @@ module Net #:nodoc:
|
|||
D 'Conn close because of keep_alive_timeout'
|
||||
@socket.close
|
||||
connect
|
||||
elsif @socket.io.wait_readable(0) && @socket.eof?
|
||||
elsif @socket.io.to_io.wait_readable(0) && @socket.eof?
|
||||
D "Conn close because of EOF"
|
||||
@socket.close
|
||||
connect
|
||||
|
|
Loading…
Add table
Reference in a new issue