aboutsummaryrefslogtreecommitdiffstats
path: root/test/net/http
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-24 01:10:07 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-24 01:10:07 +0000
commit7a1180c7457b9ac79d4fa37e296a74e0e6655f79 (patch)
tree323e484220a0f4a7f090612f4b579299e74d2c03 /test/net/http
parentaf9398ab38fa7b1f177b3079c80eb1131a2d693b (diff)
downloadruby-7a1180c7457b9ac79d4fa37e296a74e0e6655f79.tar.gz
* 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
Diffstat (limited to 'test/net/http')
-rw-r--r--test/net/http/test_http.rb12
1 files changed, 12 insertions, 0 deletions
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