serve: remove connection close hack for Python 2.3
authorMads Kiilerich <mads@kiilerich.com>
Tue, 15 Jan 2013 01:10:08 +0100
changeset 18353 a9fd11ffa13f
parent 18352 e33b9b92a200
child 18354 cf5c76017e11
serve: remove connection close hack for Python 2.3 Introduced in 276de216d2c5 and no longer needed - BaseHTTPServer handles connection closing just fine if we don't mess with its internals.
mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py	Tue Jan 15 01:07:03 2013 +0100
+++ b/mercurial/hgweb/server.py	Tue Jan 15 01:10:08 2013 +0100
@@ -129,7 +129,6 @@
                                               SocketServer.ForkingMixIn)
         env['wsgi.run_once'] = 0
 
-        self.close_connection = True
         self.saved_status = None
         self.saved_headers = []
         self.sent_headers = False
@@ -154,12 +153,8 @@
                 self.length = int(h[1])
         # The value of the Connection header is a list of case-insensitive
         # tokens separated by commas and optional whitespace.
-        if 'close' in [token.strip().lower() for token in
-                       self.headers.get('connection', '').split(',')]:
-            should_close = True
         if should_close:
             self.send_header('Connection', 'close')
-        self.close_connection = should_close
         self.end_headers()
         self.sent_headers = True