1818# https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py
1919class UnixHTTPConnection (httplib .HTTPConnection , object ):
2020
21- def __init__ (self , unix_socket_url , timeout = 60 ):
21+ def __init__ (self , unix_socket_url ):
2222 """Create an HTTP connection to a unix domain socket
2323
2424 :param unix_socket_url: A URL with a scheme of 'http+unix' and the
2525 netloc is a percent-encoded path to a unix domain socket. E.g.:
2626 'http+unix://%2Ftmp%2Fprofilesvc.sock/status/pid'
2727 """
28- super (UnixHTTPConnection , self ).__init__ ('localhost' , timeout = timeout )
28+ super (UnixHTTPConnection , self ).__init__ ('localhost' )
2929 self .unix_socket_url = unix_socket_url
30- self .timeout = timeout
3130 self .sock = None
3231
3332 def __del__ (self ): # base class does not have d'tor
@@ -44,21 +43,18 @@ def connect(self):
4443
4544class UnixHTTPConnectionPool (urllib3 .connectionpool .HTTPConnectionPool ):
4645
47- def __init__ (self , socket_path , timeout = 60 ):
48- super (UnixHTTPConnectionPool , self ).__init__ (
49- 'localhost' , timeout = timeout )
46+ def __init__ (self , socket_path ):
47+ super (UnixHTTPConnectionPool , self ).__init__ ('localhost' )
5048 self .socket_path = socket_path
51- self .timeout = timeout
5249
5350 def _new_conn (self ):
54- return UnixHTTPConnection (self .socket_path , self . timeout )
51+ return UnixHTTPConnection (self .socket_path )
5552
5653
5754class UnixAdapter (HTTPAdapter ):
5855
59- def __init__ (self , timeout = 60 , pool_connections = 25 , * args , ** kwargs ):
56+ def __init__ (self , pool_connections = 25 , * args , ** kwargs ):
6057 super (UnixAdapter , self ).__init__ (* args , ** kwargs )
61- self .timeout = timeout
6258 self .pools = urllib3 ._collections .RecentlyUsedContainer (
6359 pool_connections , dispose_func = lambda p : p .close ()
6460 )
@@ -76,7 +72,7 @@ def get_connection(self, url, proxies=None):
7672 if pool :
7773 return pool
7874
79- pool = UnixHTTPConnectionPool (url , self . timeout )
75+ pool = UnixHTTPConnectionPool (url )
8076 self .pools [url ] = pool
8177
8278 return pool
0 commit comments