diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-06-10 22:42:11 +0100 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-06-10 22:42:11 +0100 |
commit | 59eaebe0bae3d04d283be95de3837c243962461f (patch) | |
tree | 5f93365b739231356e48d4e8334708e8941c363a | |
parent | f009176f861ef77feef551e8aa3640da4bd81fcc (diff) |
mirror: Better HTTP debugging
-rw-r--r-- | mirror.php | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)]; } } |