summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mirror.php3
1 files changed, 2 insertions, 1 deletions
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)];
}
}