Mercurial > public > mercurial-scm > hg
comparison mercurial/keepalive.py @ 6001:30d2fecaab76
merge with crew-stable
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sun, 03 Feb 2008 21:47:07 -0200 |
parents | d0576d065993 6f1fcbc58efa |
children | ac0bcd951c2c |
comparison
equal
deleted
inserted
replaced
6000:8e7d64989bb8 | 6001:30d2fecaab76 |
---|---|
173 if host: | 173 if host: |
174 return list(self._hostmap.get(host, [])) | 174 return list(self._hostmap.get(host, [])) |
175 else: | 175 else: |
176 return dict(self._hostmap) | 176 return dict(self._hostmap) |
177 | 177 |
178 class HTTPHandler(urllib2.HTTPHandler): | 178 class KeepAliveHandler: |
179 def __init__(self): | 179 def __init__(self): |
180 self._cm = ConnectionManager() | 180 self._cm = ConnectionManager() |
181 | 181 |
182 #### Connection Management | 182 #### Connection Management |
183 def open_connections(self): | 183 def open_connections(self): |
312 try: | 312 try: |
313 h.request(req.get_method(), req.get_selector(), body, headers) | 313 h.request(req.get_method(), req.get_selector(), body, headers) |
314 except socket.error, err: # XXX what error? | 314 except socket.error, err: # XXX what error? |
315 raise urllib2.URLError(err) | 315 raise urllib2.URLError(err) |
316 | 316 |
317 class HTTPHandler(KeepAliveHandler, urllib2.HTTPHandler): | |
318 pass | |
319 | |
317 class HTTPResponse(httplib.HTTPResponse): | 320 class HTTPResponse(httplib.HTTPResponse): |
318 # we need to subclass HTTPResponse in order to | 321 # we need to subclass HTTPResponse in order to |
319 # 1) add readline() and readlines() methods | 322 # 1) add readline() and readlines() methods |
320 # 2) add close_connection() methods | 323 # 2) add close_connection() methods |
321 # 3) add info() and geturl() methods | 324 # 3) add info() and geturl() methods |