aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-12-31 00:24:47 +1000
committeronefang2019-12-31 00:24:47 +1000
commitcd9157a9a9b2b4e99d2ea1e69110e361a4c70f42 (patch)
tree7ef4b8969962bfea52a7568aacb653faab65b1c3
parentComplain about not finding a status code. (diff)
downloadapt-panopticon-cd9157a9a9b2b4e99d2ea1e69110e361a4c70f42.zip
apt-panopticon-cd9157a9a9b2b4e99d2ea1e69110e361a4c70f42.tar.gz
apt-panopticon-cd9157a9a9b2b4e99d2ea1e69110e361a4c70f42.tar.bz2
apt-panopticon-cd9157a9a9b2b4e99d2ea1e69110e361a4c70f42.tar.xz
Don't follow the rabbit down the rabbit hole if we are just doing low bandwidth tests.
-rwxr-xr-xapt-panopticon.lua34
1 files changed, 18 insertions, 16 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index d4bba5e..d71ab1d 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -370,22 +370,24 @@ checkHEAD = function (host, URL, r, retry, sanity)
370 checkHEAD(pu.host, location, r + 1, retry, '' ~= sanity) 370 checkHEAD(pu.host, location, r + 1, retry, '' ~= sanity)
371 else 371 else
372 I(spcd .. spcd .. "Redirect to different host. " .. check .. " " .. APT.lnk(URL) .. arw .. APT.lnk(location), host) 372 I(spcd .. spcd .. "Redirect to different host. " .. check .. " " .. APT.lnk(URL) .. arw .. APT.lnk(location), host)
373 --[[ The hard part here is that we end up throwing ALL of the test files at the redirected location. 373 if 1 <= APT.options.bandwidth.value then
374 Not good for deb.debian.org, which we should only be throwing .debs at. 374 --[[ The hard part here is that we end up throwing ALL of the test files at the redirected location.
375 What we do is loop through the DNS entries, and only test the specific protocol & file being tested here. 375 Not good for deb.debian.org, which we should only be throwing .debs at.
376 ]] 376 What we do is loop through the DNS entries, and only test the specific protocol & file being tested here.
377 local u = pu.host .. "/" .. pu.path 377 ]]
378 local file = pu.path:match(".*/([%w%.%+%-_]*)$") -- Get the filename. 378 local u = pu.host .. "/" .. pu.path
379 local path = pu.path:sub(2, -1 -(#file)) 379 local file = pu.path:match(".*/([%w%.%+%-_]*)$") -- Get the filename.
380 local check = u:gsub("/", "_") 380 local path = pu.path:sub(2, -1 -(#file))
381 local extraArgs = sendArgs .. ' -o -r ' 381 local check = u:gsub("/", "_")
382 if 'https' == pu.scheme then extraArgs = extraArgs .. ' --tests=-http' end 382 local extraArgs = sendArgs .. ' -o -r '
383 if 'http' == pu.scheme then extraArgs = extraArgs .. ' --tests=-https' end 383 if 'https' == pu.scheme then extraArgs = extraArgs .. ' --tests=-http' end
384 local pth = path:match('^(.*/pool/).*$') 384 if 'http' == pu.scheme then extraArgs = extraArgs .. ' --tests=-https' end
385 if nil ~= pth then table.insert(APT.results[PU.scheme].redirects, pu.host .. "/" .. pth) else E(spcd .. spcd .. 'Odd redirect path ' .. path) end 385 local pth = path:match('^(.*/pool/).*$')
386 I(spcd .. spcd .. "Now checking redirected host " .. u .. ' &nbsp; for &nbsp; ' .. APT.lnk(URL) .. arw .. APT.lnk(location), host) 386 if nil ~= pth then table.insert(APT.results[PU.scheme].redirects, pu.host .. "/" .. pth) else E(spcd .. spcd .. 'Odd redirect path ' .. path) end
387 APT.exe(downloadLock .. "REDIR-" .. check .. ".log.txt" .. " ./apt-panopticon.lua " .. extraArgs .. ' ' .. pu.host .. "/" .. path .. " " .. file):Nice():log():fork() 387 I(spcd .. spcd .. "Now checking redirected host " .. u .. ' &nbsp; for &nbsp; ' .. APT.lnk(URL) .. arw .. APT.lnk(location), host)
388 D(spcd .. 'logging to ' .. APT.logName(pu.host, nil, file)[2]) 388 APT.exe(downloadLock .. "REDIR-" .. check .. ".log.txt" .. " ./apt-panopticon.lua " .. extraArgs .. ' ' .. pu.host .. "/" .. path .. " " .. file):Nice():log():fork()
389 D(spcd .. 'logging to ' .. APT.logName(pu.host, nil, file)[2])
390 end
389 end 391 end
390 end 392 end
391 end 393 end