mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
minor speed optimizations (as a result of profiling)
This commit is contained in:
parent
36280b33fa
commit
10bdd90e60
|
@ -12,7 +12,7 @@ from lib.core.datatype import AttribDict
|
|||
_defaults = {
|
||||
"timeSec": 5,
|
||||
"googlePage": 1,
|
||||
"cpuThrottle": 10,
|
||||
"cpuThrottle": 5,
|
||||
"verbose": 1,
|
||||
"cDel": ";",
|
||||
"delay": 0,
|
||||
|
|
|
@ -1397,6 +1397,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]
|
||||
kb.dep = None
|
||||
kb.docRoot = None
|
||||
kb.dumpMode = False
|
||||
kb.dynamicMarkings = []
|
||||
kb.dynamicParameters = False
|
||||
kb.endDetection = False
|
||||
|
|
|
@ -209,12 +209,11 @@ def decodePage(page, contentEncoding, contentType):
|
|||
return page
|
||||
|
||||
def processResponse(page, responseHeaders):
|
||||
parseResponse(page, responseHeaders)
|
||||
if not kb.dumpMode:
|
||||
parseResponse(page, responseHeaders)
|
||||
|
||||
if conf.parseErrors:
|
||||
msg = extractErrorMessage(page)
|
||||
|
||||
if msg:
|
||||
logger.info("parsed error message: '%s'" % msg)
|
||||
|
||||
return page
|
||||
|
|
|
@ -419,7 +419,7 @@ class Connect:
|
|||
else:
|
||||
debugMsg = "got HTTP error code: %d (%s)" % (code, status)
|
||||
logger.debug(debugMsg)
|
||||
page = processResponse(page, responseHeaders)
|
||||
processResponse(page, responseHeaders)
|
||||
return page, responseHeaders
|
||||
|
||||
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e:
|
||||
|
@ -465,7 +465,7 @@ class Connect:
|
|||
finally:
|
||||
socket.setdefaulttimeout(conf.timeout)
|
||||
|
||||
page = processResponse(page, responseHeaders)
|
||||
processResponse(page, responseHeaders)
|
||||
|
||||
responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
|
||||
if responseHeaders:
|
||||
|
|
|
@ -1549,6 +1549,8 @@ class Enumeration:
|
|||
kb.data.cachedColumns = foundData
|
||||
|
||||
try:
|
||||
kb.dumpMode = True
|
||||
|
||||
if not safeSQLIdentificatorNaming(conf.db) in kb.data.cachedColumns \
|
||||
or safeSQLIdentificatorNaming(tbl, True) not in \
|
||||
kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)] \
|
||||
|
@ -1768,6 +1770,9 @@ class Enumeration:
|
|||
errMsg += "'%s'" % e
|
||||
logger.critical(errMsg)
|
||||
|
||||
finally:
|
||||
kb.dumpMode = False
|
||||
|
||||
def dumpAll(self):
|
||||
if conf.db is not None and conf.tbl is None:
|
||||
self.dumpTable()
|
||||
|
|
Loading…
Reference in New Issue
Block a user