mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Some refactoring (isMultiThreadMode fuzz)
This commit is contained in:
@@ -1016,7 +1016,7 @@ def dataToStdout(data, forceOutput=False, bold=False, contentType=None, status=C
|
||||
|
||||
if not kb.get("threadException"):
|
||||
if forceOutput or not (getCurrentThreadData().disableStdOut or kb.get("wizardMode")):
|
||||
multiThreadMode = isMultiThreadMode()
|
||||
multiThreadMode = kb.get("multiThreadMode")
|
||||
if multiThreadMode:
|
||||
logging._acquireLock()
|
||||
|
||||
@@ -2266,25 +2266,6 @@ def isHexEncodedString(subject):
|
||||
|
||||
return re.match(r"\A[0-9a-fA-Fx]+\Z", subject) is not None
|
||||
|
||||
def isMultiThreadMode():
|
||||
"""
|
||||
Checks if running in multi-thread(ing) mode
|
||||
|
||||
>>> import time
|
||||
>>> threading.activeCount()
|
||||
1
|
||||
>>> isMultiThreadMode()
|
||||
False
|
||||
>>> _ = lambda: time.sleep(0.1)
|
||||
>>> thread = threading.Thread(target=_)
|
||||
>>> thread.daemon = True
|
||||
>>> thread.start()
|
||||
>>> isMultiThreadMode()
|
||||
True
|
||||
"""
|
||||
|
||||
return threading.activeCount() > 1
|
||||
|
||||
@cachedmethod
|
||||
def getConsoleWidth(default=80):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user