Minor optimization of socket preconnect

This commit is contained in:
Miroslav Stampar
2026-02-03 12:06:46 +01:00
parent 2e6820f981
commit 2b6115c70c
3 changed files with 6 additions and 4 deletions

View File

@@ -1057,6 +1057,7 @@ def _setSocketPreConnect():
def _thread():
while kb.get("threadContinue") and not conf.get("disablePrecon"):
done = False
try:
with kb.locks.socket:
keys = list(socket._ready.keys())
@@ -1076,6 +1077,7 @@ def _setSocketPreConnect():
if q is not None and len(q) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
q.append((s, time.time()))
s = None
done = True
if s is not None:
try:
@@ -1088,7 +1090,7 @@ def _setSocketPreConnect():
except:
pass
finally:
time.sleep(0.01)
time.sleep(0.01 if not done else 0.001)
def create_connection(*args, **kwargs):
retVal = None

View File

@@ -20,7 +20,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.2.11"
VERSION = "1.10.2.12"
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)