From 77f7f216ed266bc20e0c50de057af8c4e7c3c02f Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 6 Feb 2020 14:10:33 +1000 Subject: ERROR if we can't find IPs for a mirror. --- apt-panopticon.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 515e14b..793a80f 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -1051,16 +1051,20 @@ if 0 < #arg then if nil == path then path = '' end if APT.origin then local ips = APT.results["IPs"] - 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 - 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 nil ~= ips 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 + 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 + end + D('logging to ' .. APT.logName(pu.host, k, file)[2]) end - D('logging to ' .. APT.logName(pu.host, k, file)[2]) - end - ) + ) + else + E("no IPs for " .. pu.host) + end end if not APT.redir then -- cgit v1.1