aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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