mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 19:55:47 +03:00
minor patch
This commit is contained in:
parent
9697e80013
commit
ac041399f0
|
@ -417,4 +417,4 @@ DEFAULT_GET_POST_DELIMITER = '&'
|
||||||
DEFAULT_COOKIE_DELIMITER = ';'
|
DEFAULT_COOKIE_DELIMITER = ';'
|
||||||
|
|
||||||
# Skip unforced HashDB flush requests below the threshold number of cached items
|
# Skip unforced HashDB flush requests below the threshold number of cached items
|
||||||
HASHDB_FLUSH_THRESHOLD = 10
|
HASHDB_FLUSH_THRESHOLD = 32
|
||||||
|
|
|
@ -90,20 +90,22 @@ class HashDB(object):
|
||||||
self._write_cache.clear()
|
self._write_cache.clear()
|
||||||
self._cache_lock.release()
|
self._cache_lock.release()
|
||||||
|
|
||||||
self.beginTransaction()
|
try:
|
||||||
for hash_, value in items:
|
self.beginTransaction()
|
||||||
while True:
|
for hash_, value in items:
|
||||||
try:
|
while True:
|
||||||
try:
|
try:
|
||||||
self.cursor.execute("INSERT INTO storage VALUES (?, ?)", (hash_, value,))
|
try:
|
||||||
except sqlite3.IntegrityError:
|
self.cursor.execute("INSERT INTO storage VALUES (?, ?)", (hash_, value,))
|
||||||
self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,))
|
except sqlite3.IntegrityError:
|
||||||
except sqlite3.OperationalError, ex:
|
self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,))
|
||||||
if not 'locked' in ex.message:
|
except sqlite3.OperationalError, ex:
|
||||||
raise
|
if not 'locked' in ex.message:
|
||||||
else:
|
raise
|
||||||
break
|
else:
|
||||||
self.endTransaction()
|
break
|
||||||
|
finally:
|
||||||
|
self.endTransaction()
|
||||||
|
|
||||||
def beginTransaction(self):
|
def beginTransaction(self):
|
||||||
self.cursor.execute('BEGIN TRANSACTION')
|
self.cursor.execute('BEGIN TRANSACTION')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user