mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
speedup of initial session file handling
This commit is contained in:
parent
6752e66164
commit
1e5ecbaa97
|
@ -122,9 +122,10 @@ def __setOutputResume():
|
||||||
if os.path.exists(conf.sessionFile):
|
if os.path.exists(conf.sessionFile):
|
||||||
if not conf.flushSession:
|
if not conf.flushSession:
|
||||||
readSessionFP = open(conf.sessionFile, "r")
|
readSessionFP = open(conf.sessionFile, "r")
|
||||||
lines = readSessionFP.readlines()
|
__url_cache = set()
|
||||||
|
__expression_cache = {}
|
||||||
|
|
||||||
for line in lines:
|
for line in readSessionFP.xreadlines():
|
||||||
if line.count("][") == 4:
|
if line.count("][") == 4:
|
||||||
line = line.split("][")
|
line = line.split("][")
|
||||||
|
|
||||||
|
@ -145,17 +146,20 @@ def __setOutputResume():
|
||||||
if url not in ( conf.url, conf.hostname ):
|
if url not in ( conf.url, conf.hostname ):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if url not in kb.resumedQueries.keys():
|
if url not in __url_cache:
|
||||||
kb.resumedQueries[url] = {}
|
kb.resumedQueries[url] = {}
|
||||||
kb.resumedQueries[url][expression] = value
|
kb.resumedQueries[url][expression] = value
|
||||||
|
__url_cache.add(url)
|
||||||
|
__expression_cache[url] = set()
|
||||||
|
|
||||||
resumeConfKb(expression, url, value)
|
resumeConfKb(expression, url, value)
|
||||||
|
|
||||||
if expression not in kb.resumedQueries[url].keys():
|
if expression not in __expression_cache[url]:
|
||||||
kb.resumedQueries[url][expression] = value
|
kb.resumedQueries[url][expression] = value
|
||||||
|
__expression_cache[url].add(value)
|
||||||
elif len(value) >= len(kb.resumedQueries[url][expression]):
|
elif len(value) >= len(kb.resumedQueries[url][expression]):
|
||||||
kb.resumedQueries[url][expression] = value
|
kb.resumedQueries[url][expression] = value
|
||||||
|
|
||||||
readSessionFP.close()
|
readSessionFP.close()
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user