Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #804 (defect)

Opened 3 months ago

Last modified 3 months ago

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

Status: closed (worksforme)

Reported by: guest Assigned to: fumanchu
Priority: normal Milestone:
Component: CherryPy code Keywords:
Cc:

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

here's the relevant part and fix:

Index: __init__.py
===================================================================
--- __init__.py	(revision 1942)
+++ __init__.py	(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: 

Change History

04/27/08 20:10:30: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to worksforme.

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.

Hosted by WebFaction

Log in as guest/cpguest to create tickets