From: Roman Shterenzon Date: 2011-05-27T20:23:02+09:00 Subject: [ruby-core:36507] [Ruby 1.9 - Bug #4522] Net::HTTP persistent connections Issue #4522 has been updated by Roman Shterenzon. And if it's used like in example #1, and then there's an exception (which is rescued in user code), and then a new request is issued - would it still use Keep-Alive? Because if it will, then at least the bug can be worked-around... ---------------------------------------- Bug #4522: Net::HTTP persistent connections http://redmine.ruby-lang.org/issues/4522 Author: Ricardo Amorim Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux] =begin Net::HTTP does not seem to follow HTTP 1.1 recommendations regarding persistent connections as per: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html. http://pastie.org/1710531 is a test script to reproduce the issue and inspect the TCPSocket: Example 01 works according to RFC but it's required to manually initiate the connection before using any method (GET). Example 02 shows that Net::HTTP sends a "Connection: close" header if the connection was not already open. This is not good :( Example 03 shows that Net::HTTP properly sends a "Connection: keep-alive" header but closes the socket anyways. :( I can post a patch if this issue is accepted. =end -- http://redmine.ruby-lang.org