316 def _start_transaction(self, h, req): |
316 def _start_transaction(self, h, req): |
317 _generic_start_transaction(self, h, req) |
317 _generic_start_transaction(self, h, req) |
318 return keepalive.HTTPHandler._start_transaction(self, h, req) |
318 return keepalive.HTTPHandler._start_transaction(self, h, req) |
319 |
319 |
320 if has_https: |
320 if has_https: |
321 class httpsconnection(httplib.HTTPSConnection): |
321 class httpsconnection(httplib.HTTPConnection): |
322 response_class = keepalive.HTTPResponse |
322 response_class = keepalive.HTTPResponse |
|
323 default_port = httplib.HTTPS_PORT |
323 # must be able to send big bundle as stream. |
324 # must be able to send big bundle as stream. |
324 send = _gen_sendfile(keepalive.safesend) |
325 send = _gen_sendfile(keepalive.safesend) |
325 getresponse = keepalive.wrapgetresponse(httplib.HTTPSConnection) |
326 getresponse = keepalive.wrapgetresponse(httplib.HTTPConnection) |
|
327 |
|
328 def __init__(self, host, port=None, key_file=None, cert_file=None, |
|
329 *args, **kwargs): |
|
330 httplib.HTTPConnection.__init__(self, host, port, *args, **kwargs) |
|
331 self.key_file = key_file |
|
332 self.cert_file = cert_file |
326 |
333 |
327 def connect(self): |
334 def connect(self): |
328 self.sock = _create_connection((self.host, self.port)) |
335 self.sock = _create_connection((self.host, self.port)) |
329 |
336 |
330 host = self.host |
337 host = self.host |