# HG changeset patch # User Julien Cristau # Date 2023-03-21 14:27:03 # Node ID 3bb7c56e8fe63e7c5577f3fb09669969afe62663 # Parent af776c3d5c3e520a074f60450f6b476f7dfeee00 url: don't ignore timeout for https connections For http, we use the stdlib's HTTPConnection.connect which passes the timeout down to socket.create_connection; for https, we override the connect method but weren't handling the timeout, so connections could hang for hours even with http.timeout set to low values. diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -327,7 +327,9 @@ if has_https: self.cert_file = cert_file def connect(self): - self.sock = socket.create_connection((self.host, self.port)) + self.sock = socket.create_connection( + (self.host, self.port), self.timeout + ) host = self.host realhostport = self.realhostport # pytype: disable=attribute-error