mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
minor refactoring
This commit is contained in:
parent
17c39fe231
commit
dcad5410fe
|
@ -2379,3 +2379,10 @@ def intersect(valueA, valueB):
|
|||
retVal = [val for val in arrayizeValue(valueA) if val in arrayizeValue(valueB)]
|
||||
|
||||
return retVal
|
||||
|
||||
def cpuThrottle(value):
|
||||
"""
|
||||
Does a CPU throttling for a lesser CPU consumption
|
||||
"""
|
||||
delay = 0.00001 * (value ** 2)
|
||||
time.sleep(delay)
|
||||
|
|
|
@ -20,6 +20,7 @@ from lib.core.agent import agent
|
|||
from lib.core.common import average
|
||||
from lib.core.common import calculateDeltaSeconds
|
||||
from lib.core.common import clearConsoleLine
|
||||
from lib.core.common import cpuThrottle
|
||||
from lib.core.common import getCurrentThreadData
|
||||
from lib.core.common import getFilteredPageContent
|
||||
from lib.core.common import unicodeToSafeHTMLValue
|
||||
|
@ -70,8 +71,7 @@ class Connect:
|
|||
if conf.delay is not None and isinstance(conf.delay, (int, float)) and conf.delay > 0:
|
||||
time.sleep(conf.delay)
|
||||
elif conf.cpuThrottle:
|
||||
delay = 0.00001 * (conf.cpuThrottle ** 2)
|
||||
time.sleep(delay)
|
||||
cpuThrottle(conf.cpuThrottle)
|
||||
|
||||
threadData = getCurrentThreadData()
|
||||
threadData.lastRequestUID += 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user