Issue #804 resolved

http1.0 connections are persistent by default (like 1.1 connections)

created an issue

1.0 connections should be persistent only if keep-alive is specified.

here's the relevant part and fix:

{{{ Index: =================================================================== --- (revision 1942) +++ (working copy) @@ -405,7 +405,7 @@ environ["REMOTE_USER"] = user

     # Persistent connection support
  • if self.response_protocol == "HTTP/1.1":
  • if req_protocol == "HTTP/1.1": if environ.get("HTTP_CONNECTION", "") == "close": self.close_connection = True else: }}}

Comments (2)

  1. Robert Brewer

    Hmmmmm... I don't think that code does what you think it does. The attribute self.response_protocol is set (just above there) to the ''smaller'' of the HTTP versions for the request message and what the server supports. So if:

    1) an HTTP/1.0 message arrives, response_protocol will be "HTTP/1.0" regardless of server version, 2) the server is set to only support HTTP/1.0, response_protocol will be "HTTP/1.0" regardless of the version of the message

    I think you're describing scenario 2, but it doesn't matter because it looks like the right thing happens in all cases.

  2. Log in to comment