b.t.h._.ConnectionHandler(urllib2.BaseHandler) : class documentation

Part of bzrlib.transport.http._urllib2_wrappers View In Hierarchy

Provides connection-sharing by pre-processing requests.

urllib2 provides no way to access the HTTPConnection object internally used. But we need it in order to achieve connection sharing. So, we add it to the request just before it is processed, and then we override the do_open method for http[s] requests in AbstractHTTPHandler.

Method __init__ Undocumented
Method create_connection Undocumented
Method capture_connection Capture or inject the request connection.
Method http_request Undocumented
Method https_request Undocumented
def __init__(self, report_activity=None):
def create_connection(self, request, http_connection_class):
def capture_connection(self, request, http_connection_class):

Capture or inject the request connection.

Two cases: - the request have no connection: create a new one,

  • the request have a connection: this one have been used already, let's capture it, so that we can give it to another transport to be reused. We don't do that ourselves: the Transport object get the connection from a first request and then propagate it, from request to request or to cloned transports.
def http_request(self, request):
def https_request(self, request):
API Documentation for Bazaar, generated by pydoctor at 2020-05-29 00:47:57.