aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-09-29 12:27:52 +1000
committeronefang2019-09-29 12:27:52 +1000
commitaddb2ff4ef8a0ada410722ea43e6335f3e4f905d (patch)
tree78af16f3b8a02912ee28bbdf5542c978ec2781d8
parentcheckURL -> checkHEAD (diff)
downloadapt-panopticon-addb2ff4ef8a0ada410722ea43e6335f3e4f905d.zip
apt-panopticon-addb2ff4ef8a0ada410722ea43e6335f3e4f905d.tar.gz
apt-panopticon-addb2ff4ef8a0ada410722ea43e6335f3e4f905d.tar.bz2
apt-panopticon-addb2ff4ef8a0ada410722ea43e6335f3e4f905d.tar.xz
checkPaths -> checkFiles
-rw-r--r--README.md6
-rwxr-xr-xmirror-checker.lua8
2 files changed, 7 insertions, 7 deletions
diff --git a/README.md b/README.md
index 7ac867b..fe62f04 100644
--- a/README.md
+++ b/README.md
@@ -243,10 +243,10 @@ written yet. Note that currently this downloads 4GB per mirror.
243 243
244Calls checkRedirects() with the host as first and second arguments, and 244Calls checkRedirects() with the host as first and second arguments, and
245includes the IP this time. The inclusion of the IP causes 245includes the IP this time. The inclusion of the IP causes
246checkRedirects() to call checkPaths(). 246checkRedirects() to call checkFiles().
247 247
248 248
249checkPaths() will call checkHEAD() for each of the reference files. 249checkFiles() will call checkHEAD() for each of the reference files.
250 250
251 251
252checkHEAD() uses LuaSocket (or LuaSec for HTTPS) to send a HEAD request to 252checkHEAD() uses LuaSocket (or LuaSec for HTTPS) to send a HEAD request to
@@ -255,5 +255,5 @@ not be followed by that request. If the request returns a redirect, then
255checkHEAD() is called recursively. If the redirect is to some host we are 255checkHEAD() is called recursively. If the redirect is to some host we are
256not already checking, we call checkRedirects() on it, with an IP of 256not already checking, we call checkRedirects() on it, with an IP of
257"redir". This causes checkRedirects() to bypass the test that would 257"redir". This causes checkRedirects() to bypass the test that would
258otherwise call checkPaths(), instead gathering the IPs and fork as usual. 258otherwise call checkFiles(), instead gathering the IPs and fork as usual.
259 259
diff --git a/mirror-checker.lua b/mirror-checker.lua
index 23c7e33..f443789 100755
--- a/mirror-checker.lua
+++ b/mirror-checker.lua
@@ -275,7 +275,7 @@ checkHEAD = function (host, URL, r, retry)
275 end 275 end
276end 276end
277 277
278local checkPaths = function (host, ip, path, file) 278local checkFiles = function (host, ip, path, file)
279 if nil ~= file then 279 if nil ~= file then
280 if "redirect" == ip then ip = host end 280 if "redirect" == ip then ip = host end
281 I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file) 281 I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file)
@@ -313,13 +313,13 @@ checkRedirects = function (orig, host, path, ip, file)
313 local po = url.parse("http://" .. orig) 313 local po = url.parse("http://" .. orig)
314 if "" ~= file then 314 if "" ~= file then
315 D("checking redirected file " .. po.host .. " " .. file) 315 D("checking redirected file " .. po.host .. " " .. file)
316 checkPaths(po.host, ip, path, file) 316 checkFiles(po.host, ip, path, file)
317 else 317 else
318 checkPaths(po.host, ip, path) 318 checkFiles(po.host, ip, path)
319 end 319 end
320 else 320 else
321 if orig == host then D("checkRedirects " .. orig .. "" .. file) else D("checkRedirects " .. orig .. " -> " .. host) end 321 if orig == host then D("checkRedirects " .. orig .. "" .. file) else D("checkRedirects " .. orig .. " -> " .. host) end
322-- TODO - use checkPaths() here ^^^ on the original domain name, coz that's not getting caught yet. I think. 322-- TODO - use checkFiles() here ^^^ on the original domain name, coz that's not getting caught yet. I think.
323 gatherIPs(ph.host) 323 gatherIPs(ph.host)
324 for k, v in pairs(IP[ph.host]) do 324 for k, v in pairs(IP[ph.host]) do
325 D(" DNS record " .. v .. " " .. ph.host .. " -> " .. k) 325 D(" DNS record " .. v .. " " .. ph.host .. " -> " .. k)