mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
Fixes #1550
This commit is contained in:
parent
7fa9c8e938
commit
a5489516eb
|
@ -1027,12 +1027,13 @@ def _setSocketPreConnect():
|
||||||
def _():
|
def _():
|
||||||
while kb.threadContinue:
|
while kb.threadContinue:
|
||||||
try:
|
try:
|
||||||
for address in socket._ready:
|
for key in socket._ready:
|
||||||
if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
|
if len(socket._ready[key]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
|
||||||
s = socket.socket()
|
family, type, proto, address = key
|
||||||
|
s = socket.socket(family, type, proto)
|
||||||
s._connect(address)
|
s._connect(address)
|
||||||
with kb.locks.socket:
|
with kb.locks.socket:
|
||||||
socket._ready[address].append(s._sock)
|
socket._ready[key].append(s._sock)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
|
@ -1040,11 +1041,12 @@ def _setSocketPreConnect():
|
||||||
|
|
||||||
def connect(self, address):
|
def connect(self, address):
|
||||||
found = False
|
found = False
|
||||||
|
key = (self.family, self.type, self.proto, address)
|
||||||
with kb.locks.socket:
|
with kb.locks.socket:
|
||||||
if address not in socket._ready:
|
if key not in socket._ready:
|
||||||
socket._ready[address] = []
|
socket._ready[key] = []
|
||||||
if len(socket._ready[address]) > 0:
|
if len(socket._ready[key]) > 0:
|
||||||
self._sock = socket._ready[address].pop(0)
|
self._sock = socket._ready[key].pop(0)
|
||||||
found = True
|
found = True
|
||||||
if not found:
|
if not found:
|
||||||
self._connect(address)
|
self._connect(address)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user