1
0
Fork 0
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:
naruse 2015-11-27 15:03:24 +00:00
parent 36326ceb22
commit dab944e319

View file

@ -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