D4855: url: have httpsconnection inherit from our custom HTTPConnection

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Oct 3 20:07:37 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf2dffa1359c6: url: have httpsconnection inherit from our custom HTTPConnection (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4855?vs=11633&id=11662

REVISION DETAIL
  https://phab.mercurial-scm.org/D4855

AFFECTED FILES
  mercurial/keepalive.py
  mercurial/url.py

CHANGE DETAILS

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -339,16 +339,16 @@
         return logginghttpconnection(createconnection, *args, **kwargs)
 
 if has_https:
-    class httpsconnection(httplib.HTTPConnection):
+    class httpsconnection(keepalive.HTTPConnection):
         response_class = keepalive.HTTPResponse
         default_port = httplib.HTTPS_PORT
         # must be able to send big bundle as stream.
         send = _gen_sendfile(keepalive.safesend)
         getresponse = keepalive.wrapgetresponse(httplib.HTTPConnection)
 
         def __init__(self, host, port=None, key_file=None, cert_file=None,
                      *args, **kwargs):
-            httplib.HTTPConnection.__init__(self, host, port, *args, **kwargs)
+            keepalive.HTTPConnection.__init__(self, host, port, *args, **kwargs)
             self.key_file = key_file
             self.cert_file = cert_file
 
diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -615,6 +615,10 @@
     return safegetresponse
 
 class HTTPConnection(httplib.HTTPConnection):
+    # url.httpsconnection inherits from this. So when adding/removing
+    # attributes, be sure to audit httpsconnection() for unintended
+    # consequences.
+
     # use the modified response class
     response_class = HTTPResponse
     send = safesend



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list