Skip to content

Commit ed9fdbd

Browse files
committed
Minor improvement
1 parent bbfcf81 commit ed9fdbd

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

data/txt/sha256sums.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ fad6640f60eac8ad1b65895cbccc39154864843a2a0b0f2ac596d3227edcd4f6 lib/controller
163163
1947e6c69fbc2bdce91d2836e5c9c9535e397e9271ae4b4ef922f7a01857df5e lib/controller/handler.py
164164
4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/controller/__init__.py
165165
216c9399853b7454d36dcb552baf9f1169ec7942897ddc46504684325cb6ce00 lib/core/agent.py
166-
a61a74ba17331c419c03bc90d829ba74d183787f39fd902f50198202cb5b26c7 lib/core/bigarray.py
166+
440cbab6161f466158c63f0ee97873254655f670ca990fa26bdd0a6e54c42c2a lib/core/bigarray.py
167167
8920eb3115ecd25933084af986f453362aa55a4bd15bfb9e75673239bd206acc lib/core/common.py
168168
d53a8aecab8af8b8da4dc1c74d868f70a38770d34b1fa50cae4532cae7ce1c87 lib/core/compat.py
169169
ebe518089733722879f5a13e73020ebe55d46fb7410cacf292ca4ea1d9d1c56a lib/core/convert.py
@@ -186,7 +186,7 @@ c4bfb493a03caf84dd362aec7c248097841de804b7413d0e1ecb8a90c8550bc0 lib/core/readl
186186
d1bd70c1a55858495c727fbec91e30af267459c8f64d50fabf9e4ee2c007e920 lib/core/replication.py
187187
1d0f80b0193ac5204527bfab4bde1a7aee0f693fd008e86b4b29f606d1ef94f3 lib/core/revision.py
188188
d2eb8e4b05ac93551272b3d4abfaf5b9f2d3ac92499a7704c16ed0b4f200db38 lib/core/session.py
189-
37d96cd99b3011c3173ac7ae3992fd3a8aa5caea892e9fd8ab5a1b442dee3aa0 lib/core/settings.py
189+
aa86123af7058e4d98ddaf50c40329c4ebf6b71233f605915ff3a21d34018449 lib/core/settings.py
190190
1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py
191191
4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py
192192
cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py

lib/core/bigarray.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import os
1515
import sys
1616
import tempfile
17+
import threading
1718
import zlib
1819

1920
from lib.core.compat import xrange
@@ -74,6 +75,7 @@ def __init__(self, items=None):
7475
self.chunk_length = sys.maxsize
7576
self.cache = None
7677
self.filenames = set()
78+
self._lock = threading.Lock()
7779
self._os_remove = os.remove
7880
self._size_counter = 0
7981

@@ -95,18 +97,19 @@ def __iadd__(self, value):
9597
return self
9698

9799
def append(self, value):
98-
self.chunks[-1].append(value)
99-
100-
if self.chunk_length == sys.maxsize:
101-
self._size_counter += _size_of(value)
102-
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
103-
self.chunk_length = len(self.chunks[-1])
104-
self._size_counter = None
105-
106-
if len(self.chunks[-1]) >= self.chunk_length:
107-
filename = self._dump(self.chunks[-1])
108-
self.chunks[-1] = filename
109-
self.chunks.append([])
100+
with self._lock:
101+
self.chunks[-1].append(value)
102+
103+
if self.chunk_length == sys.maxsize:
104+
self._size_counter += _size_of(value)
105+
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
106+
self.chunk_length = len(self.chunks[-1])
107+
self._size_counter = None
108+
109+
if len(self.chunks[-1]) >= self.chunk_length:
110+
filename = self._dump(self.chunks[-1])
111+
self.chunks[-1] = filename
112+
self.chunks.append([])
110113

111114
def extend(self, value):
112115
for _ in value:

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from thirdparty import six
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.9.5.19"
22+
VERSION = "1.9.5.20"
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)

0 commit comments

Comments
 (0)