MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MDX / SpeedtestHTTPHandler

Class SpeedtestHTTPHandler

lib/speed.py:536–555  ·  view source on GitHub ↗

Custom ``HTTPHandler`` that can build a ``HTTPConnection`` with the args we need for ``source_address`` and ``timeout``

Source from the content-addressed store, hash-verified

534
535
536class SpeedtestHTTPHandler(AbstractHTTPHandler):
537 """Custom ``HTTPHandler`` that can build a ``HTTPConnection`` with the
538 args we need for ``source_address`` and ``timeout``
539 """
540 def __init__(self, debuglevel=0, source_address=None, timeout=10):
541 AbstractHTTPHandler.__init__(self, debuglevel)
542 self.source_address = source_address
543 self.timeout = timeout
544
545 def http_open(self, req):
546 return self.do_open(
547 _build_connection(
548 SpeedtestHTTPConnection,
549 self.source_address,
550 self.timeout
551 ),
552 req
553 )
554
555 http_request = AbstractHTTPHandler.do_request_
556
557
558class SpeedtestHTTPSHandler(AbstractHTTPHandler):

Callers 1

build_openerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected