From fab1f109d0564b44c950055d3233d6e7a1f3be81 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 23 Feb 2023 02:26:36 +1000 Subject: Add yet another timeout watchdog. --- apt-panopticon.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apt-panopticon.lua') diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 8fd39e5..93243a4 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -330,7 +330,7 @@ checkHEAD = function (host, URL, r, retry, sanity) 'curl -I --retry 0 -s --path-as-is --connect-timeout ' .. APT.options.timeout.value .. ' --max-redirs 0 ' .. APT.IPv46 .. ' ' .. IP .. ' ' .. '-o /dev/null -D results/"HEADERS_' .. fname .. '" ' .. hdr .. ' -w "#%{http_code} %{ssl_verify_result} %{url_effective}\\n" ' .. PU.scheme .. '://' .. host .. PU.path .. ' >>results/"STATUS_' .. fname .. '"' - ):Nice():log():Do().status + ):timeout(APT.options.maxtime.value * 2.0):Nice():log():Do().status if 0 < r then APT.tested(PU.scheme, 'Redirects', host) else @@ -356,7 +356,7 @@ checkHEAD = function (host, URL, r, retry, sanity) if 0 ~= status then local msg = curlStatus[status] if nil == msg then msg = "UNKNOWN CURL STATUS CODE!" end - if (28 == status) or (7 == status) then + if (128+9 == status) or (124 == status) or (28 == status) or (7 == status) then T(spcd .. spcd .. "TIMEOUT " .. timeouts + 1 .. ", retry " .. retry + 1 .. ' ' .. APT.lnk(URL), PU.scheme, sanity, host) timeouts = timeouts + 1 else @@ -447,7 +447,7 @@ checkHEAD = function (host, URL, r, retry, sanity) local pth = path:match('^(.*/pool/).*$') if nil ~= pth then table.insert(APT.results[PU.scheme].redirects, pu.host .. "/" .. pth) else E(spcd .. spcd .. 'Odd redirect path ' .. path) end I(spcd .. spcd .. "Now checking redirected host " .. u .. '   for   ' .. APT.lnk(URL) .. arw .. APT.lnk(location), host) - APT.exe(downloadLock .. "REDIR-" .. check .. ".log.txt" .. " ./apt-panopticon.lua " .. extraArgs .. ' ' .. pu.host .. "/" .. path .. " " .. file):Nice():log():fork() + APT.exe(downloadLock .. "REDIR-" .. check .. ".log.txt" .. " ./apt-panopticon.lua " .. extraArgs .. ' ' .. pu.host .. "/" .. path .. " " .. file):timeout(APT.options.maxtime.value * 2.0):Nice():log():fork(pu.host) D(spcd .. 'logging to ' .. APT.logName(pu.host, nil, file)[2]) APT.tested(PU.scheme, 'Redirects', host) end @@ -534,7 +534,7 @@ checkHost = function (orig, host, path, ip, file) else if orig == host then I("Testing mirror " .. orig .. "" .. file) - APT.exe("./apt-panopticon.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file):Nice():log():fork() + APT.exe("./apt-panopticon.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file):timeout(APT.options.maxtime.value * 2.0):Nice():log():fork(orig) D('logging to ' .. APT.logName(ph.host, nil, file)[2]) else D("checkHost " .. orig .. arw .. host) end end @@ -618,7 +618,7 @@ local downloads = function(host, URL, meta, release, list) end end f:close() - APT.exe(cm):Nice():log():fork() + APT.exe(cm):timeout(APT.options.maxtime.value * 2.0):Nice():log():fork(host) D('logging to ' .. log .. ', with these files') end @@ -1129,9 +1129,9 @@ if 0 < #arg then APT.allpairs(ips, function(k, v) if v == "A" then - if APT.testing("IPv4") then APT.exe('./apt-panopticon.lua ' .. sendArgs .. ' -4 ' .. pu.host .. path .. ' ' .. k .. ' ' .. file):Nice():log():fork() end + if APT.testing("IPv4") then APT.exe('./apt-panopticon.lua ' .. sendArgs .. ' -4 ' .. pu.host .. path .. ' ' .. k .. ' ' .. file):timeout(APT.options.maxtime.value * 2.0):Nice():log():fork(pu.host) end elseif v == "AAAA" then - if APT.testing("IPv6") then APT.exe('./apt-panopticon.lua ' .. sendArgs .. ' -6 ' .. APT.IPv46 .. ' ' .. pu.host .. path .. ' ' .. k .. ' ' .. file):Nice():log():fork() end + if APT.testing("IPv6") then APT.exe('./apt-panopticon.lua ' .. sendArgs .. ' -6 ' .. APT.IPv46 .. ' ' .. pu.host .. path .. ' ' .. k .. ' ' .. file):timeout(APT.options.maxtime.value * 2.0):Nice():log():fork(pu.host) end end D('logging to ' .. APT.logName(pu.host, k, file)[2]) end -- cgit v1.1