Project

General

Profile

Actions

Bug #4522

closed

Net::HTTP persistent connections

Added by mksm (Ricardo Amorim) about 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
Backport:
[ruby-core:<unknown>]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0