MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / comp

Function comp

thirdparty/keepalive/keepalive.py:552–568  ·  view source on GitHub ↗
(N, url)

Source from the content-addressed store, hash-verified

550 print(format % ('keepalive readline', m.hexdigest()))
551
552def comp(N, url):
553 print(' making %i connections to:\n %s' % (N, url))
554
555 sys.stdout.write(' first using the normal urllib handlers')
556 # first use normal opener
557 opener = _urllib.request.build_opener()
558 _urllib.request.install_opener(opener)
559 t1 = fetch(N, url)
560 print(' TIME: %.3f s' % t1)
561
562 sys.stdout.write(' now using the keepalive handler ')
563 # now install the keepalive handler and try again
564 opener = _urllib.request.build_opener(HTTPHandler())
565 _urllib.request.install_opener(opener)
566 t2 = fetch(N, url)
567 print(' TIME: %.3f s' % t2)
568 print(' improvement factor: %.2f' % (t1/t2, ))
569
570def fetch(N, url, delay=0):
571 import time

Callers 1

testFunction · 0.85

Calls 3

fetchFunction · 0.85
HTTPHandlerClass · 0.85
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…