From 937299ff5126768c16b97366ac9c6dc1c6d9eb7c Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 26 Dec 2019 13:28:30 +1000 Subject: Protocol change is an ERROR for the round robin, not a WARNING. --- apt-panopticon.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 8b8728b..9d2b783 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -352,7 +352,13 @@ checkHEAD = function (host, URL, r, retry, sanity) if nil ~= location then pu = url.parse(location, defaultURL) if ('http' == location:sub(1, 4)) and (pu.scheme ~= PU.scheme) then -- Sometimes a location sans scheme is returned, this is not a protocol change. - if APT.testing("Protocol") then W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. location, PU.scheme, "Protocol", host) end + if APT.testing("Protocol") then + if APT.options.roundRobin.value == host then -- Coz HTTPS shouldn't happen via the round robin. + E(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. location, PU.scheme, "Protocol", host) + end + W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. location, PU.scheme, "Protocol", host) + else + end end if location == URL then @@ -613,7 +619,7 @@ local getMirrors = function () end end if APT.testing("DNSRR") then - mirrors[APT.options.roundRobin.value] = { ["Protocols"] = { ["http"] = true; ["https"] = true; }; ['Updated'] = 300; + mirrors[APT.options.roundRobin.value] = { ["Protocols"] = { ["http"] = true; }; ['Updated'] = 300; ["FQDN"] = APT.options.roundRobin.value; ["Active"] = 'yes'; ["BaseURL"] = APT.options.roundRobin.value; } end local file, e = io.open("results/mirrors.lua", "w+") -- cgit v1.1