From e515ed7ec6391b8b24eded18221ee3b77542ae84 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Thu, 2 Feb 2023 15:32:38 -0800 Subject: [PATCH] Provide a timeout on the iperf client. This cryptic bit of shell script adds a maximum timeout for the iperf client to run as it appears it can get stuck occasionally. The server has a built-in timeout (not available in client mode) --- files/www/cgi-bin/iperf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/www/cgi-bin/iperf b/files/www/cgi-bin/iperf index 6b81cb72..3fb62290 100755 --- a/files/www/cgi-bin/iperf +++ b/files/www/cgi-bin/iperf @@ -75,7 +75,7 @@ else f:close(); end if status:match("running") then - print("SUCCESS
Client: " .. node .. "\nServer: " .. server .. "\n" .. io.popen("/usr/bin/iperf3 --forceflush -b 0 -Z -c " .. server .. (protocol == "udp" and " -u" or "") .. " 2>&1"):read("*a") .. "
") + print("SUCCESS
Client: " .. node .. "\nServer: " .. server .. "\n" .. io.popen("p=$$;setsid sh -c \"(sleep 20; kill $p)\" > /dev/null 2>&1 & /usr/bin/iperf3 --forceflush -b 0 -Z -c " .. server .. (protocol == "udp" and " -u" or "") .. " 2>&1"):read("*a") .. "
") else print("SERVER ERROR
iperf client failed to start server
") end