From 7a1180c7457b9ac79d4fa37e296a74e0e6655f79 Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 24 Feb 2012 01:10:07 +0000 Subject: * lib/net/http.rb (Net::HTTP#transport_request): Fix infinite loop upon EOFError or Errno::ECONNRESET where count is reset to 0. * test/net/http/test_http.rb (class TestNetHTTPKeepAlive): Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/net/http/test_http.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/net') diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 6de57d3196..e2cfb42670 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -605,4 +605,16 @@ class TestNetHTTPKeepAlive < Test::Unit::TestCase assert_kind_of String, res.body } end + + def test_keep_alive_EOF + def @server.run(sock) + sock.close + end + + start {|http| + assert_raises(EOFError) { + res = http.get('/') + } + } + end end -- cgit v1.2.3