Major silent bug fix to multi-threading functionality. Thanks Nico Leidecker for reporting!

This commit is contained in:
Bernardo Damele 2009-05-20 09:34:13 +00:00
parent f7ee4d578e
commit 13de8366d0

View File

@ -140,6 +140,7 @@ def bisection(payload, expression, length=None, charsetType=None):
def downloadThread():
try:
while True:
idxlock.acquire()
@ -168,11 +169,6 @@ def bisection(payload, expression, length=None, charsetType=None):
dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), s))
iolock.release()
def downloadThreadProxy(numThread):
try:
downloadThread()
except (sqlmapConnectionException, sqlmapValueException), errMsg:
conf.threadException = True
logger.error("thread %d: %s" % (numThread + 1, errMsg))
@ -199,7 +195,7 @@ def bisection(payload, expression, length=None, charsetType=None):
# Start the threads
for numThread in range(numThreads):
thread = threading.Thread(target=downloadThreadProxy(numThread))
thread = threading.Thread(target=downloadThread)
thread.start()
threads.append(thread)