mercurial/keepalive.py
changeset 45942 89a2afe31e82
parent 45352 49f8ba4febec
child 46113 59fa3890d40a
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
   110 
   110 
   111 class ConnectionManager(object):
   111 class ConnectionManager(object):
   112     """
   112     """
   113     The connection manager must be able to:
   113     The connection manager must be able to:
   114       * keep track of all existing
   114       * keep track of all existing
   115       """
   115     """
   116 
   116 
   117     def __init__(self):
   117     def __init__(self):
   118         self._lock = threading.Lock()
   118         self._lock = threading.Lock()
   119         self._hostmap = collections.defaultdict(list)  # host -> [connection]
   119         self._hostmap = collections.defaultdict(list)  # host -> [connection]
   120         self._connmap = {}  # map connections to host
   120         self._connmap = {}  # map connections to host
   673         if reraise:
   673         if reraise:
   674             raise
   674             raise
   675 
   675 
   676 
   676 
   677 def wrapgetresponse(cls):
   677 def wrapgetresponse(cls):
   678     """Wraps getresponse in cls with a broken-pipe sane version.
   678     """Wraps getresponse in cls with a broken-pipe sane version."""
   679     """
       
   680 
   679 
   681     def safegetresponse(self):
   680     def safegetresponse(self):
   682         # In safesend() we might set the _broken_pipe_resp
   681         # In safesend() we might set the _broken_pipe_resp
   683         # attribute, in which case the socket has already
   682         # attribute, in which case the socket has already
   684         # been closed and we just need to give them the response
   683         # been closed and we just need to give them the response