mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-23 01:56:36 +03:00
Fixes #1393
This commit is contained in:
parent
924e31c414
commit
e59a220199
|
@ -10,7 +10,7 @@ import threading
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from thread import error as threadError
|
from thread import error as ThreadError
|
||||||
|
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
|
@ -89,9 +89,9 @@ def exceptionHandledFunction(threadFunction):
|
||||||
kb.threadContinue = False
|
kb.threadContinue = False
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
raise
|
raise
|
||||||
except Exception, errMsg:
|
except Exception, ex:
|
||||||
# thread is just going to be silently killed
|
# thread is just going to be silently killed
|
||||||
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
|
logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message))
|
||||||
|
|
||||||
def setDaemon(thread):
|
def setDaemon(thread):
|
||||||
# Reference: http://stackoverflow.com/questions/190010/daemon-threads-explanation
|
# Reference: http://stackoverflow.com/questions/190010/daemon-threads-explanation
|
||||||
|
@ -145,8 +145,8 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
|
|
||||||
try:
|
try:
|
||||||
thread.start()
|
thread.start()
|
||||||
except threadError, errMsg:
|
except ThreadError, ex:
|
||||||
errMsg = "error occurred while starting new thread ('%s')" % errMsg
|
errMsg = "error occurred while starting new thread ('%s')" % ex.message
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -178,10 +178,10 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
if forwardException:
|
if forwardException:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except (SqlmapConnectionException, SqlmapValueException), errMsg:
|
except (SqlmapConnectionException, SqlmapValueException), ex:
|
||||||
print
|
print
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
|
logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message))
|
||||||
|
|
||||||
except:
|
except:
|
||||||
from lib.core.common import unhandledExceptionMessage
|
from lib.core.common import unhandledExceptionMessage
|
||||||
|
|
Loading…
Reference in New Issue
Block a user