Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50dde39

Browse files
committed
minor update
1 parent e9bf768 commit 50dde39

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

lib/core/threads.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ def exceptionHandledFunction(threadFunction):
6060
kb.threadContinue = False
6161
kb.threadException = True
6262
raise
63-
except:
64-
kb.threadContinue = False
65-
kb.threadException = True
63+
except Exception, errMsg:
64+
# thread is just going to be silently killed
65+
print
66+
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
6667

6768
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False):
6869
threads = []

lib/techniques/blind/inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def downloadThread():
390390
except (sqlmapConnectionException, sqlmapValueException), errMsg:
391391
print
392392
kb.threadException = True
393-
logger.error("thread %d: %s" % (numThread + 1, errMsg))
393+
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
394394

395395
except KeyboardInterrupt:
396396
kb.threadException = True
@@ -409,7 +409,7 @@ def downloadThread():
409409
print
410410
kb.threadException = True
411411
errMsg = unhandledExceptionMessage()
412-
logger.error("thread %d: %s" % (numThread + 1, errMsg))
412+
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
413413
traceback.print_exc()
414414

415415
# Start the threads

0 commit comments

Comments
 (0)