summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mirror.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/mirror.php b/mirror.php
index 9a6706f..866d66a 100644
--- a/mirror.php
+++ b/mirror.php
@@ -40,10 +40,8 @@ if (!file_exists($root.'/'.$filename)) {
$mirror = $tier0_url;
if (!should_force_tier0($filename)) {
$ctime = lstat($root.'/'.$filename)['ctime'];
- if ($ctime < $min_ctime) {
- $ctime = $min_ctime;
- }
- header('X-Repomirror-C-Time: '.$ctime);
+ header('X-Repomirror-File-C-Time: '.$ctime);
+ header('X-Repomirror-Min-C-Time: '.$min_ctime);
// TODO: weight by GeoIP or quality or something?
$mirrors = array();
foreach ($mirrors_urls as $mirrors_url) {
@@ -59,7 +57,7 @@ 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; }
+ if (strtotime($urldata['last_sync']) < max($ctime, $min_ctime)) { continue; }
header('X-Repomirror-Mirror'.count($mirrors).': '.strtotime($urldata['last_sync']).' '.$urldata['url']);
$mirrors[] = $urldata['url'];
}