aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-10-06 10:02:41 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-10-06 10:02:41 +0200
commit43c4d30579ff359d3ebfcdf7e37bc4b7df611fb5 (patch)
tree515fd52c1f58b890645b044db29c6457669edbd9
parent01e2e4c3cbe738c93f43a0e418df6bc20a0c363c (diff)
downloadpaccache-43c4d30579ff359d3ebfcdf7e37bc4b7df611fb5.tar.gz
paccache-43c4d30579ff359d3ebfcdf7e37bc4b7df611fb5.tar.zst
fix guess the fastest server for db files
New db files were not fetched from upstream servers if one server had a file with same timestamp.
-rw-r--r--pacredir.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pacredir.c b/pacredir.c
index fbb09bd..12bd03d 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -444,8 +444,11 @@ static int ahc_echo(void * cls,
if (request->http_code == MHD_HTTP_OK &&
/* for db files choose the most recent server */
- ((dbfile == 1 && request->last_modified >= last_modified &&
- request->time_total < time_total) ||
+ ((dbfile == 1 && ((request->last_modified > last_modified) ||
+ /* but use a faster server if available */
+ (url != NULL &&
+ request->last_modified >= last_modified &&
+ request->time_total < time_total))) ||
/* for packages try to guess the fastest server */
(dbfile == 0 && request->time_total < time_total))) {
if (url != NULL)