mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-23 16:09:03 +00:00
some code refactoring and beautification
This commit is contained in:
@@ -1245,7 +1245,7 @@ def parseXmlFile(xmlFile, handler):
|
||||
|
||||
def readCachedFileContent(filename, mode='rb'):
|
||||
if filename not in kb.cache.content:
|
||||
kb.data.cacheLock.acquire()
|
||||
kb.locks.cacheLock.acquire()
|
||||
|
||||
if filename not in kb.cache.content:
|
||||
checkFile(filename)
|
||||
@@ -1254,7 +1254,7 @@ def readCachedFileContent(filename, mode='rb'):
|
||||
kb.cache.content[filename] = content
|
||||
xfile.close()
|
||||
|
||||
kb.data.cacheLock.release()
|
||||
kb.locks.cacheLock.release()
|
||||
|
||||
return kb.cache.content[filename]
|
||||
|
||||
|
||||
@@ -1028,8 +1028,6 @@ def __setKnowledgeBaseAttributes():
|
||||
kb.commonOutputs = None
|
||||
|
||||
kb.data = advancedDict()
|
||||
kb.data.cacheLock = threading.Lock()
|
||||
kb.data.seqLock = None
|
||||
|
||||
# Basic back-end DBMS fingerprint
|
||||
kb.dbms = None
|
||||
@@ -1053,6 +1051,11 @@ def __setKnowledgeBaseAttributes():
|
||||
kb.keywords = set(getFileItems(paths.SQL_KEYWORDS))
|
||||
kb.lastErrorPage = None
|
||||
kb.lastRequestUID = 0
|
||||
|
||||
kb.locks = advancedDict()
|
||||
kb.locks.cacheLock = threading.Lock()
|
||||
kb.locks.seqLock = None
|
||||
|
||||
kb.nullConnection = None
|
||||
|
||||
# Back-end DBMS underlying operating system fingerprint via banner (-b)
|
||||
|
||||
Reference in New Issue
Block a user