Skip to content

Commit a0b6741

Browse files
committed
Just in case update
1 parent 7e78554 commit a0b6741

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/core/option.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ def _setSocketPreConnect():
10281028
return
10291029

10301030
def _():
1031-
while kb.threadContinue:
1031+
while kb.threadContinue and not conf.disablePrecon:
10321032
try:
10331033
for key in socket._ready:
10341034
if len(socket._ready[key]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
@@ -1046,13 +1046,15 @@ def _():
10461046

10471047
def connect(self, address):
10481048
found = False
1049+
10491050
key = (self.family, self.type, self.proto, address)
10501051
with kb.locks.socket:
10511052
if key not in socket._ready:
10521053
socket._ready[key] = []
10531054
if len(socket._ready[key]) > 0:
10541055
self._sock = socket._ready[key].pop(0)
10551056
found = True
1057+
10561058
if not found:
10571059
self._connect(address)
10581060

lib/request/connect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,9 @@ class _(dict):
614614
elif "forcibly closed" in tbMsg or "Connection is already closed" in tbMsg:
615615
warnMsg = "connection was forcibly closed by the target URL"
616616
elif "timed out" in tbMsg:
617+
singleTimeWarnMessage("turning off pre-connect mechanism because of connection time out(s)")
618+
conf.disablePrecon = True
619+
617620
if kb.testMode and kb.testType not in (None, PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED):
618621
singleTimeWarnMessage("there is a possibility that the target (or WAF) is dropping 'suspicious' requests")
619622
warnMsg = "connection timed out to the target URL"

0 commit comments

Comments
 (0)