summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-04-28 01:05:55 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-04-28 01:05:55 +0000
commitec7e2eccfb0cfc17c774a60912061cb2338c7d51 (patch)
tree78e1539dc109184161ec95d8b1217afbe0947bb8
parent9799e60b9016490133edf22c7874255a8ce4508a (diff)
downloadcherrypy-ec7e2eccfb0cfc17c774a60912061cb2338c7d51.tar.gz
Comments.
-rw-r--r--cherrypy/wsgiserver/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cherrypy/wsgiserver/__init__.py b/cherrypy/wsgiserver/__init__.py
index 0f93aa83..f8d3112e 100644
--- a/cherrypy/wsgiserver/__init__.py
+++ b/cherrypy/wsgiserver/__init__.py
@@ -406,10 +406,11 @@ class HTTPRequest(object):
# Persistent connection support
if self.response_protocol == "HTTP/1.1":
+ # Both server and client are HTTP/1.1
if environ.get("HTTP_CONNECTION", "") == "close":
self.close_connection = True
else:
- # HTTP/1.0
+ # Either the server or client (or both) are HTTP/1.0
if environ.get("HTTP_CONNECTION", "") != "Keep-Alive":
self.close_connection = True
@@ -640,9 +641,11 @@ class HTTPRequest(object):
if "connection" not in hkeys:
if self.response_protocol == 'HTTP/1.1':
+ # Both server and client are HTTP/1.1 or better
if self.close_connection:
self.outheaders.append(("Connection", "close"))
else:
+ # Server and/or client are HTTP/1.0
if not self.close_connection:
self.outheaders.append(("Connection", "Keep-Alive"))