Minor fine tuning

This commit is contained in:
Miroslav Stampar
2025-12-30 09:53:26 +01:00
parent 0e74e43846
commit bf2d3a5315
3 changed files with 8 additions and 7 deletions

View File

@@ -66,7 +66,7 @@ class BigArray(list):
"""
List-like class used for storing large amounts of data (disk cached)
>>> _ = BigArray(xrange(100000))
>>> _ = BigArray(xrange(100000), chunk_size=500 * 1024)
>>> _[20] = 0
>>> _[-1] = 999
>>> _[99999]
@@ -97,7 +97,7 @@ class BigArray(list):
100000
"""
def __init__(self, items=None):
def __init__(self, items=None, chunk_size=BIGARRAY_CHUNK_SIZE):
self.chunks = [[]]
self.chunk_length = sys.maxsize
self.cache = None
@@ -105,6 +105,7 @@ class BigArray(list):
self._lock = threading.Lock()
self._os_remove = os.remove
self._size_counter = 0
self._chunk_size = chunk_size
for item in (items or []):
self.append(item)
@@ -129,7 +130,7 @@ class BigArray(list):
if self.chunk_length == sys.maxsize:
self._size_counter += _size_of(value)
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
if self._size_counter >= self._chunk_size:
self.chunk_length = len(self.chunks[-1])
self._size_counter = None

View File

@@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.9.12.31"
VERSION = "1.9.12.32"
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)
@@ -655,7 +655,7 @@ WAF_ATTACK_VECTORS = (
ROTATING_CHARS = ('\\', '|', '|', '/', '-')
# Approximate chunk length (in bytes) used by BigArray objects (only last chunk and cached one are held in memory)
BIGARRAY_CHUNK_SIZE = 1024 * 1024
BIGARRAY_CHUNK_SIZE = 32 * 1024 * 1024
# Compress level used for storing BigArray chunks to disk (0-9)
BIGARRAY_COMPRESS_LEVEL = 4