mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-25 17:09:02 +00:00
Some memory improvements of @cachedmethod
This commit is contained in:
@@ -2691,6 +2691,7 @@ def enumValueToNameLookup(type_, value_):
|
||||
|
||||
return retVal
|
||||
|
||||
@cachedmethod
|
||||
def extractRegexResult(regex, content, flags=0):
|
||||
"""
|
||||
Returns 'result' group value from a possible match with regex on a given
|
||||
|
||||
@@ -14,11 +14,11 @@ def cachedmethod(f, cache={}):
|
||||
|
||||
def _(*args, **kwargs):
|
||||
try:
|
||||
key = (f, tuple(args), frozenset(kwargs.items()))
|
||||
key = hash((f, tuple(args), frozenset(kwargs.items())))
|
||||
if key not in cache:
|
||||
cache[key] = f(*args, **kwargs)
|
||||
except:
|
||||
key = "".join(str(_) for _ in (f, args, kwargs))
|
||||
key = hash("".join(str(_) for _ in (f, args, kwargs)))
|
||||
if key not in cache:
|
||||
cache[key] = f(*args, **kwargs)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.1.11.7"
|
||||
VERSION = "1.1.11.8"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user