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

Function fetch

thirdparty/keepalive/keepalive.py:570–588  ·  view source on GitHub ↗
(N, url, delay=0)

Source from the content-addressed store, hash-verified

568 print(' improvement factor: %.2f' % (t1/t2, ))
569
570def fetch(N, url, delay=0):
571 import time
572 lens = []
573 starttime = time.time()
574 for i in _range(N):
575 if delay and i > 0: time.sleep(delay)
576 fo = _urllib.request.urlopen(url)
577 foo = fo.read()
578 fo.close()
579 lens.append(len(foo))
580 diff = time.time() - starttime
581
582 j = 0
583 for i in lens[1:]:
584 j = j + 1
585 if not i == lens[0]:
586 print("WARNING: inconsistent length on read %i: %i" % (j, i))
587
588 return diff
589
590def test_timeout(url):
591 global DEBUG

Callers 1

compFunction · 0.85

Calls 3

readMethod · 0.45
closeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…