mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
some more cleanup
This commit is contained in:
parent
d5e80089ff
commit
facce2c0df
|
@ -147,9 +147,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
hintlock = threading.Lock()
|
||||
|
||||
def tryHint(idx):
|
||||
hintlock.acquire()
|
||||
with hintlock:
|
||||
hintValue = kb.hintValue
|
||||
hintlock.release()
|
||||
|
||||
if hintValue is not None and len(hintValue) >= idx:
|
||||
if Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.ACCESS, DBMS.MAXDB, DBMS.DB2):
|
||||
|
@ -164,9 +163,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
if result:
|
||||
return hintValue[idx-1]
|
||||
|
||||
hintlock.acquire()
|
||||
with hintlock:
|
||||
kb.hintValue = None
|
||||
hintlock.release()
|
||||
|
||||
return None
|
||||
|
||||
|
@ -373,10 +371,9 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
else:
|
||||
break
|
||||
|
||||
kb.locks.value.acquire()
|
||||
with kb.locks.value:
|
||||
threadData.shared.value[curidx - 1] = val
|
||||
currentValue = list(threadData.shared.value)
|
||||
kb.locks.value.release()
|
||||
|
||||
if kb.threadContinue:
|
||||
if showEta:
|
||||
|
|
|
@ -333,13 +333,11 @@ def errorUse(expression, expected=None, dump=False):
|
|||
threadData = getCurrentThreadData()
|
||||
|
||||
while kb.threadContinue:
|
||||
kb.locks.limits.acquire()
|
||||
with kb.locks.limits:
|
||||
try:
|
||||
num = threadData.shared.limits.next()
|
||||
except StopIteration:
|
||||
break
|
||||
finally:
|
||||
kb.locks.limits.release()
|
||||
|
||||
output = __errorFields(expression, expressionFields, expressionFieldsList, expected, num)
|
||||
|
||||
|
@ -349,9 +347,8 @@ def errorUse(expression, expected=None, dump=False):
|
|||
if output and isinstance(output, list) and len(output) == 1:
|
||||
output = output[0]
|
||||
|
||||
kb.locks.outputs.acquire()
|
||||
with kb.locks.outputs:
|
||||
threadData.shared.outputs.append(output)
|
||||
kb.locks.outputs.release()
|
||||
|
||||
runThreads(numThreads, errorThread)
|
||||
|
||||
|
|
|
@ -283,13 +283,11 @@ def unionUse(expression, unpack=True, dump=False):
|
|||
threadData = getCurrentThreadData()
|
||||
|
||||
while kb.threadContinue:
|
||||
kb.locks.limits.acquire()
|
||||
with kb.locks.limits:
|
||||
try:
|
||||
num = threadData.shared.limits.next()
|
||||
except StopIteration:
|
||||
break
|
||||
finally:
|
||||
kb.locks.limits.release()
|
||||
|
||||
if Backend.getIdentifiedDbms() in (DBMS.MSSQL, DBMS.SYBASE):
|
||||
field = expressionFieldsList[0]
|
||||
|
@ -309,10 +307,9 @@ def unionUse(expression, unpack=True, dump=False):
|
|||
items = parseUnionPage(output)
|
||||
if isNoneValue(items):
|
||||
continue
|
||||
kb.locks.value.acquire()
|
||||
with kb.locks.value:
|
||||
for item in arrayizeValue(items):
|
||||
threadData.shared.value.append(item)
|
||||
kb.locks.value.release()
|
||||
else:
|
||||
items = output.replace(kb.chars.start, "").replace(kb.chars.stop, "").split(kb.chars.delimiter)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user