mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-02-05 21:16:34 +00:00
Minor optimization of socket preconnect
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user