diff options
author | Christian Hesse <mail@eworm.de> | 2022-02-10 14:41:19 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-11-13 21:16:57 +0100 |
commit | 333d74e170b5f1f0022f98e65544db4455f4d24a (patch) | |
tree | e6e814f7efdf7475242a6b6cf13d25418a564fae | |
parent | 534b71d3e276ed537471773fd6f627431674d8d1 (diff) | |
download | pacredir-333d74e170b5f1f0022f98e65544db4455f4d24a.tar.gz pacredir-333d74e170b5f1f0022f98e65544db4455f4d24a.tar.zst |
drop setting to ignore db files...cacheserver
Using just `CacheServer` (and commenting `Server`) in pacman
configuration has the same effect.
-rw-r--r-- | pacredir.c | 15 | ||||
-rw-r--r-- | pacredir.conf | 4 |
2 files changed, 2 insertions, 17 deletions
@@ -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 ***/ @@ -429,12 +429,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))) { @@ -568,9 +562,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) @@ -707,9 +699,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 |