From 59eaebe0bae3d04d283be95de3837c243962461f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 10 Jun 2016 22:42:11 +0100 Subject: mirror: Better HTTP debugging --- mirror.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirror.php b/mirror.php index cb48b43..ff463f4 100644 --- a/mirror.php +++ b/mirror.php @@ -36,6 +36,7 @@ if (!file_exists($root.'/'.$filename)) { $mirror = $tier0_url; if (!should_force_tier0($filename)) { $ctime = lstat($root.'/'.$filename)['ctime']; + header('X-Repomirror-C-Time: '.$ctime); // TODO: weight by GeoIP or quality or something? $mirrors = array(); foreach ($mirrors_urls as $mirrors_url) { @@ -43,11 +44,11 @@ if (!file_exists($root.'/'.$filename)) { foreach ($json['urls'] as $urldata) { if (!in_array($urldata['protocol'], ['http', 'https', 'ftp'])) { continue; } if (strtotime($urldata['last_sync']) < $ctime) { continue; } + header('X-Repomirror-Mirror'.count($mirrors).': '.strtotime($urldata['last_sync']).' '.$urldata['url']); $mirrors[] = $urldata['url']; } } if (count($mirrors) > 0) { - header('X-Repomirror-Mirrors: '.implode(' ', $mirrors)); $mirror = $mirrors[array_rand($mirrors)]; } } -- cgit v1.2.2