From e4fb574acba84e51feab84f79c317f68da363b85 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 10 Feb 2022 14:41:19 +0100 Subject: drop setting to ignore db files... Using just `CacheServer` (with commented `Server`) in pacman configuration has the same effect. --- pacredir.c | 15 ++------------- pacredir.conf | 4 ---- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/pacredir.c b/pacredir.c index 9fa5921..c54d344 100644 --- a/pacredir.c +++ b/pacredir.c @@ -33,7 +33,7 @@ struct hosts * hosts = NULL; struct ignore_interfaces * ignore_interfaces = NULL; int max_threads = 0; static AvahiSimplePoll *simple_poll = NULL; -uint8_t verbose = 0, ignore_db_files = 0; +uint8_t verbose = 0; unsigned int count_redirect = 0, count_not_found = 0; /*** write_log ***/ @@ -424,12 +424,6 @@ static mhd_result ahc_echo(void * cls, dbfile = 1; - /* return 404 if database file are disabled */ - if (ignore_db_files > 0) { - http_code = MHD_HTTP_NOT_FOUND; - goto response; - } - /* get timestamp from request */ if ((if_modified_since = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, MHD_HTTP_HEADER_IF_MODIFIED_SINCE))) { @@ -563,9 +557,7 @@ response: ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, response); free(url); } else { - if (dbfile > 0 && ignore_db_files > 0) - write_log(stdout, "Ignoring request for db file %s.\n", basename); - else if (req_count < 0) + if (req_count < 0) write_log(stdout, "Currently no peers are available to check for %s.\n", basename); else if (dbfile > 0) @@ -703,9 +695,6 @@ int main(int argc, char ** argv) { if (verbose > 0 && max_threads > 0) write_log(stdout, "Limiting number of threads to a maximum of %d\n", max_threads); - /* whether to ignore db files */ - ignore_db_files = iniparser_getboolean(ini, "general:ignore db files", ignore_db_files); - /* store interfaces to ignore */ if ((inistring = iniparser_getstring(ini, "general:ignore interfaces", NULL)) != NULL) { values = strdup(inistring); diff --git a/pacredir.conf b/pacredir.conf index 0cbd667..e0d86ab 100644 --- a/pacredir.conf +++ b/pacredir.conf @@ -10,10 +10,6 @@ max threads = 0 #max threads = 32 -# Set this to true if you want to ignore database files, to always download -# them from mirrors. -ignore db files = false - # Some people like to run avahi on network interfaces with low bandwidth or # high cost, for example to use 'Bonjour' (Link-Local Messaging) on it. # Add these interfaces here to ignore them by pacredir. Just give multiple -- cgit v1.2.3-54-g00ecf