mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
fix for a bug reported by Ulisses Castro (Too many open files) - also, added an important caching mechanism with thread safe logic
This commit is contained in:
parent
720e235d9a
commit
73b33ed765
4 changed files with 19 additions and 5 deletions
|
|
@ -1239,13 +1239,20 @@ def getConsoleWidth(default=80):
|
|||
return width if width else default
|
||||
|
||||
def parseXmlFile(xmlFile, handler):
|
||||
checkFile(xmlFile)
|
||||
xfile = codecs.open(xmlFile, 'rb', conf.dataEncoding)
|
||||
content = xfile.read()
|
||||
stream = StringIO(content)
|
||||
if xmlFile not in kb.cache.content:
|
||||
if conf.parseLock:
|
||||
conf.parseLock.acquire()
|
||||
if xmlFile not in kb.cache.content:
|
||||
checkFile(xmlFile)
|
||||
xfile = codecs.open(xmlFile, 'rb', conf.dataEncoding)
|
||||
content = xfile.read()
|
||||
kb.cache.content[xmlFile] = content
|
||||
xfile.close()
|
||||
if conf.parseLock:
|
||||
conf.parseLock.release()
|
||||
stream = StringIO(kb.cache.content[xmlFile])
|
||||
parse(stream, handler)
|
||||
stream.close()
|
||||
xfile.close()
|
||||
|
||||
def readXmlFile(xmlFile):
|
||||
checkFile(xmlFile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue