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