From 3b58f79240410ac1603ab6eb2a94bff1b62d1409 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 28 Jun 2019 15:38:04 +1000 Subject: Line up some of the messages better. --- mirror-checker.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mirror-checker.lua b/mirror-checker.lua index aada1e2..4a82309 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -193,34 +193,34 @@ checkURL = function (host, URL, r, retry) return end local PU = url.parse(URL, defaultURL) - D(" " .. PU.scheme .. " :// " .. check .. " " .. host .. " -> " .. URL) + D(PU.scheme .. " :// " .. check .. " " .. host .. " -> " .. URL) if not testing(PU.scheme) then D("not testing " .. PU.scheme .. " " .. host .. " -> " .. URL); return end local hd = {Host = host} local p, c, h, s = http.request{method = "HEAD", redirect = false, url = URL, headers = hd} if nil == s then s = "" end if nil == p then - E(c .. " " .. s .. "! " .. check .. " " .. host .. " -> " .. URL) + E(" " .. c .. " " .. s .. "! " .. check .. " " .. host .. " -> " .. URL) -- So far the only errors are "timeout", "Network is unreachable", and "closed", and I suspect "closed" is due to saturating my bandwidth. -- Might be worthwhile retrying those, some number of times. if ("closed" == c) or ("Network is unreachable" == c) or ("timeout" == c) then checkURL(host, URL, r, retry + 1) end else if ("4" == tostring(c):sub(1, 1)) or ("5" == tostring(c):sub(1, 1)) then - E(c .. " " .. s .. ". " .. check .. " " .. host .. " -> " .. URL) + E(" " .. c .. " " .. s .. ". " .. check .. " " .. host .. " -> " .. URL) else - I(c .. " " .. s .. ". " .. check .. " " .. host .. " -> " .. URL) + I(" " .. c .. " " .. s .. ". " .. check .. " " .. host .. " -> " .. URL) end l = h.location if nil ~= l then local pu = url.parse(l, defaultURL) if l == URL then - E("redirect loop! " .. check .. " " .. host .. " -> " .. URL) + E(" redirect loop! " .. check .. " " .. host .. " -> " .. URL) else if nil == pu.host then - W("no location host! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) + W(" no location host! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) checkURL(host, PU.scheme .. "://" .. PU.host .. l, r + 1) else if testing("Protocol") and pu.scheme ~= PU.scheme then - W("protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) + W(" protocol changed during redirect! " .. check .. " " .. host .. " -> " .. URL .. " -> " .. l) end checkURL(pu.host, l, r + 1, retry) end @@ -247,7 +247,7 @@ local checkPaths = function (host, ip, path) end local execute = function (s) - D("executing " .. s) + D(" executing " .. s) os.execute(s) end -- cgit v1.1