301 |
302 |
302 class logginghttpconnection(keepalive.HTTPConnection): |
303 class logginghttpconnection(keepalive.HTTPConnection): |
303 def __init__(self, createconn, *args, **kwargs): |
304 def __init__(self, createconn, *args, **kwargs): |
304 keepalive.HTTPConnection.__init__(self, *args, **kwargs) |
305 keepalive.HTTPConnection.__init__(self, *args, **kwargs) |
305 self._create_connection = createconn |
306 self._create_connection = createconn |
|
307 |
|
308 if sys.version_info < (2, 7, 7): |
|
309 # copied from 2.7.14, since old implementations directly call |
|
310 # socket.create_connection() |
|
311 def connect(self): |
|
312 self.sock = self._create_connection((self.host, self.port), |
|
313 self.timeout, |
|
314 self.source_address) |
|
315 if self._tunnel_host: |
|
316 self._tunnel() |
306 |
317 |
307 class logginghttphandler(httphandler): |
318 class logginghttphandler(httphandler): |
308 """HTTP handler that logs socket I/O.""" |
319 """HTTP handler that logs socket I/O.""" |
309 def __init__(self, logfh, name, observeropts): |
320 def __init__(self, logfh, name, observeropts): |
310 super(logginghttphandler, self).__init__() |
321 super(logginghttphandler, self).__init__() |