diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-27 15:03:24 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-27 15:03:24 +0000 |
commit | dab944e3194f996156278cbfb74caa8e70fb0f5c (patch) | |
tree | 0b2a908c0abf18bf16c05af7202841ff282312d3 /lib | |
parent | 36326ceb22d114ec75675806d2c434f89ad417d1 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index 65cacbd175..fa6185b0ba 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -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 |