From 9bebcd9c517e575a023be0d1843acc4054d1363e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 May 2022 11:44:35 +0200 Subject: more solutions for caveat with pacman's server error limit --- README.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a2b4cba..ff1091a 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,11 @@ However `pacredir` sends a "*404 - not found*" response if the file is not available in local network - and is skipped after just three misses. This new feature is not configurable at runtime, so rebuilding `pacman` with -this patch is the only way to make things work with `pacredir`. +one of the following patches is the way to make things work with `pacredir`. + +### Disable server error limit + +This is the simplest workaround - just disable the server error limit. --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -93,9 +97,30 @@ this patch is the only way to make things work with `pacredir`. struct server_error_count { char server[HOSTNAME_SIZE]; -Let's hope +We can agree this is not to be desired - in general the feature is reasonable. + +### Support http header to indicate an expected failure + +This solution is simple, yet powerful: +[Support http header to indicate an expected failure](patches/0001-support-http-header-to-indicate-an-expected-failure.patch) + +By setting an extra HTTP header `X-Pacman-Expected-Failure` the server can +indicate that the failure is expected. The next server is tried without +error message and without increasing the server's error count. + +Sadly upstream denied. 😢 + +### Implement CacheServer + +A more complex solution that breaks current API is: +[Implement CacheServer](patches/0001-implement-CacheServer.patch) + +This implements a new configuration option `CacheServer`. Adding a cache +server makes it ignore the server error limit. + +Handling for soft failures is demanded in a long standing upstream bug, and +the given patch could solve it: [FS#23407 - Allow soft failures on Server URLs](https://bugs.archlinux.org/task/23407) -is implemented any time soon. Security -------- -- cgit v1.2.3-54-g00ecf