[CherryPy] #804: http1.0 connections are persistent by default (like 1.1 connections)

0 views
Skip to first unread message

CherryPy

unread,
Apr 16, 2008, 8:25:30 PM4/16/08
to cherrypy...@googlegroups.com
#804: http1.0 connections are persistent by default (like 1.1 connections)
---------------------------+------------------------------------------------
Reporter: guest | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Keywords:
---------------------------+------------------------------------------------
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:
}}}

--
Ticket URL: <http://www.cherrypy.org/ticket/804>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework

CherryPy

unread,
Apr 27, 2008, 9:10:35 PM4/27/08
to cherrypy...@googlegroups.com
#804: http1.0 connections are persistent by default (like 1.1 connections)
---------------------------+------------------------------------------------
Reporter: guest | Owner: fumanchu
Type: defect | Status: closed
Priority: normal | Milestone:
Component: CherryPy code | Resolution: worksforme
Keywords: |
---------------------------+------------------------------------------------
Changes (by fumanchu):

* resolution: => worksforme
* status: new => closed

Comment:

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.
Reply all
Reply to author
Forward
0 new messages