diff options
-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)]; } } |