mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-25 08:59:02 +00:00
code refactoring regarding standard output suppression and some threading issues
This commit is contained in:
@@ -341,11 +341,11 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||
|
||||
except (sqlmapConnectionException, sqlmapValueException), errMsg:
|
||||
print
|
||||
conf.threadException = True
|
||||
kb.threadException = True
|
||||
logger.error("thread %d: %s" % (numThread + 1, errMsg))
|
||||
|
||||
except KeyboardInterrupt:
|
||||
conf.threadException = True
|
||||
kb.threadException = True
|
||||
|
||||
print
|
||||
logger.debug("waiting for threads to finish")
|
||||
@@ -359,7 +359,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||
|
||||
except:
|
||||
print
|
||||
conf.threadException = True
|
||||
kb.threadException = True
|
||||
errMsg = unhandledException()
|
||||
logger.error("thread %d: %s" % (numThread + 1, errMsg))
|
||||
traceback.print_exc()
|
||||
@@ -505,7 +505,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||
if not partialValue:
|
||||
dataToSessionFile("]\n")
|
||||
|
||||
if conf.threadException:
|
||||
if kb.threadException:
|
||||
raise sqlmapThreadException, "something unexpected happened inside the threads"
|
||||
|
||||
return queriesCount[0], finalValue
|
||||
|
||||
@@ -80,7 +80,17 @@ def tableExists(tableFile):
|
||||
thread.join(5)
|
||||
except KeyboardInterrupt:
|
||||
kb.threadContinue = False
|
||||
raise
|
||||
kb.threadException = True
|
||||
|
||||
print
|
||||
logger.debug("waiting for threads to finish")
|
||||
|
||||
try:
|
||||
while (threading.activeCount() > 1):
|
||||
pass
|
||||
|
||||
except KeyboardInterrupt:
|
||||
raise sqlmapThreadException, "user aborted"
|
||||
finally:
|
||||
kb.locks.seqLock = None
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import re
|
||||
import time
|
||||
|
||||
from lib.core.agent import agent
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.common import extractRegexResult
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import initTechnique
|
||||
@@ -60,9 +61,6 @@ def errorUse(expression):
|
||||
|
||||
if output:
|
||||
output = output.replace(kb.misc.space, " ")
|
||||
|
||||
if conf.verbose > 0:
|
||||
infoMsg = "retrieved: %s" % replaceNewlineTabs(output, stdout=True)
|
||||
logger.info(infoMsg)
|
||||
dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), replaceNewlineTabs(output, stdout=True)))
|
||||
|
||||
return output
|
||||
|
||||
Reference in New Issue
Block a user