tests: Fix ap_wps_er_http_proto max concurrent requests case

Commit 2d6a526ac3 ('tests: Make
ap_wps_er_http_proto more robust') tried to work around the timeouts
here, but that was not really the best approach since the one second
timeout that was used here for connect() ended up being very close to
the limit even before the kernel change. The longer connect() time is
caused by a sequence where the listen() backlog ignores the connection
instead of accept() followed by close() within the wpa_supplicant ER
HTTP connection handling. The time to retransmit the SYN changed a bit
in the kernel from 1.0 sec to about 1.03 sec. This was enough to push
that over the one second timeout.

Fix this by using a sufficiently long timeout (10 sec) to allow SYN
retransmission to occur to recover from the listen() backlog case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-08-17 12:24:59 +03:00 committed by Jouni Malinen
parent 50348c5c32
commit e5d3e13a5c

View file

@ -4418,11 +4418,8 @@ RGV2aWNlIEEQSQAGADcqAAEg
for i in range(20):
socks[i] = socket.socket(socket.AF_INET, socket.SOCK_STREAM,
socket.IPPROTO_TCP)
try:
socks[i].connect(addr)
except:
logger.info("connect %d failed" % i)
pass
socks[i].settimeout(10)
socks[i].connect(addr)
for i in range(20):
socks[i].send("GET / HTTP/1.1\r\n\r\n")
count = 0