Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d87b0f

Browse files
committed
Fixes #3467 and #3463
1 parent 6f750f9 commit 4d87b0f

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

lib/core/datatype.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,12 @@ def __contains__(self, key):
120120
return key in self.cache
121121

122122
def __getitem__(self, key):
123-
try:
124-
value = self.cache.pop(key)
125-
self.cache[key] = value
126-
return value
127-
except KeyError:
128-
return -1
123+
value = self.cache.pop(key)
124+
self.cache[key] = value
125+
return value
129126

130127
def get(self, key):
131-
return self.__getitem__(self, key)
128+
return self.__getitem__(key)
132129

133130
def __setitem__(self, key, value):
134131
try:

lib/core/decorators.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ def cachedmethod(f, cache=LRUDict(capacity=MAX_CACHE_ITEMS)):
2424

2525
@functools.wraps(f)
2626
def _(*args, **kwargs):
27-
with _lock:
28-
key = int(hashlib.md5("|".join(str(_) for _ in (f, args, kwargs))).hexdigest(), 16) & 0x7fffffffffffffff
29-
if key not in cache:
30-
cache[key] = f(*args, **kwargs)
27+
key = int(hashlib.md5("|".join(str(_) for _ in (f, args, kwargs))).hexdigest(), 16) & 0x7fffffffffffffff
3128

32-
return cache[key]
29+
try:
30+
result = cache[key]
31+
except KeyError:
32+
result = f(*args, **kwargs)
33+
34+
with _lock:
35+
cache[key] = result
36+
37+
return result
3338

3439
return _
3540

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.3.2.14"
22+
VERSION = "1.3.2.15"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ a932126e7d80e545c5d44af178d0bc0c lib/core/bigarray.py
3333
964885db1ac028fa622ee5ba20f061b1 lib/core/common.py
3434
de8d27ae6241163ff9e97aa9e7c51a18 lib/core/convert.py
3535
abcb1121eb56d3401839d14e8ed06b6e lib/core/data.py
36-
e1f7758f433202c50426efde5eb96768 lib/core/datatype.py
37-
1646402a733e564f05025e848b323cf9 lib/core/decorators.py
36+
00828c4455321b6987e3f882f4ef4f92 lib/core/datatype.py
37+
3ec93893ad8b1e060540753b7f8a8caf lib/core/decorators.py
3838
5f4680b769ae07f22157bd832c97cf8f lib/core/defaults.py
3939
9dfc69ba47209a4ceca494dde9ee8183 lib/core/dicts.py
4040
4ba141124699fd7a763dea82f17fe523 lib/core/dump.py
@@ -50,7 +50,7 @@ d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py
5050
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5151
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5252
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
53-
8aa51078439218dacde3c4283ed22845 lib/core/settings.py
53+
75098335768c0cfa062995a83ceaef78 lib/core/settings.py
5454
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5555
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5656
43772ea73e9e3d446f782af591cb4eda lib/core/target.py

0 commit comments

Comments
 (0)