summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-07-01 14:04:23 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-07-01 14:19:33 +0200
commitd4ca52db773f2e799e84150428bf705bd78d1624 (patch)
treecab1d4ac11d430101e12458a3d2a4b38530adf7b
parentedbadb4ad430651654435e5d605a20ff9da172f8 (diff)
downloadpacredir-d4ca52db773f2e799e84150428bf705bd78d1624.tar.gz
pacredir-d4ca52db773f2e799e84150428bf705bd78d1624.tar.zst
use proper log message when ignoring database files
-rw-r--r--pacredir.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pacredir.c b/pacredir.c
index 051ff67..210c7d3 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -410,13 +410,14 @@ static int ahc_echo(void * cls,
if ((strlen(basename) > 3 && strcmp(basename + strlen(basename) - 3, ".db") == 0) ||
(strlen(basename) > 6 && strcmp(basename + strlen(basename) - 6, ".files") == 0)) {
+ dbfile = 1;
+
/* return 404 if database file are disabled */
if (ignore_db_files > 0) {
http_code = MHD_HTTP_NOT_FOUND;
goto response;
}
- dbfile = 1;
/* get timestamp of local file */
filename = malloc(strlen(SYNCPATH) + strlen(basename) + 2);
sprintf(filename, SYNCPATH "/%s", basename);
@@ -553,10 +554,12 @@ response:
ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, response);
free(url);
} else {
- if (req_count < 0)
+ if (dbfile > 0 && ignore_db_files > 0)
+ write_log(stdout, "Ignoring request for db file %s.\n", basename);
+ else if (req_count < 0)
write_log(stdout, "Currently no servers are available to check for %s.\n",
basename);
- else if (dbfile == 1)
+ else if (dbfile > 0)
write_log(stdout, "No more recent version of %s found on %d servers.\n",
basename, req_count + 1);
else