diff mercurial/keepalive.py @ 5983:6f1fcbc58efa

httprepo: use separate handlers for HTTP and HTTPS This is needed to keep the code in keepalive.py from sharing the same connection between HTTP and HTTPS. 52ce0d6bc375 explains why we were using a single handler. This should fix issue892.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 03 Feb 2008 21:03:46 -0200
parents 8520a773a141
children 30d2fecaab76
line wrap: on
line diff
--- a/mercurial/keepalive.py	Sun Feb 03 21:03:46 2008 -0200
+++ b/mercurial/keepalive.py	Sun Feb 03 21:03:46 2008 -0200
@@ -175,7 +175,7 @@
         else:
             return dict(self._hostmap)
 
-class HTTPHandler(urllib2.HTTPHandler):
+class KeepAliveHandler:
     def __init__(self):
         self._cm = ConnectionManager()
 
@@ -314,6 +314,9 @@
         except socket.error, err: # XXX what error?
             raise urllib2.URLError(err)
 
+class HTTPHandler(KeepAliveHandler, urllib2.HTTPHandler):
+    pass
+
 class HTTPResponse(httplib.HTTPResponse):
     # we need to subclass HTTPResponse in order to
     # 1) add readline() and readlines() methods