mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Fixes #5619
This commit is contained in:
parent
acd9831917
commit
305d79846f
|
@ -6,6 +6,7 @@ See the file 'LICENSE' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
import threading
|
||||||
import types
|
import types
|
||||||
|
|
||||||
from thirdparty.odict import OrderedDict
|
from thirdparty.odict import OrderedDict
|
||||||
|
@ -142,6 +143,7 @@ class LRUDict(object):
|
||||||
def __init__(self, capacity):
|
def __init__(self, capacity):
|
||||||
self.capacity = capacity
|
self.capacity = capacity
|
||||||
self.cache = OrderedDict()
|
self.cache = OrderedDict()
|
||||||
|
self.__lock = threading.Lock()
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self.cache)
|
return len(self.cache)
|
||||||
|
@ -158,11 +160,12 @@ class LRUDict(object):
|
||||||
return self.__getitem__(key)
|
return self.__getitem__(key)
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
try:
|
with self.__lock:
|
||||||
self.cache.pop(key)
|
try:
|
||||||
except KeyError:
|
self.cache.pop(key)
|
||||||
if len(self.cache) >= self.capacity:
|
except KeyError:
|
||||||
self.cache.popitem(last=False)
|
if len(self.cache) >= self.capacity:
|
||||||
|
self.cache.popitem(last=False)
|
||||||
self.cache[key] = value
|
self.cache[key] = value
|
||||||
|
|
||||||
def set(self, key, value):
|
def set(self, key, value):
|
||||||
|
|
|
@ -20,7 +20,7 @@ from thirdparty import six
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.8.1.6"
|
VERSION = "1.8.1.7"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user