CacheServer option (or whatever to work around server error limit)

Christian Hesse list at eworm.de
Wed Jan 19 20:36:37 UTC 2022


Christian Hesse <list at eworm.de> on Thu, 2022/01/13 16:06:
> Christian Hesse <list at eworm.de> on Thu, 2022/01/13 15:44:
> > Allan McRae <allan at archlinux.org> on Fri, 2022/01/14 00:36:  
> > > On 14/1/22 00:12, Christian Hesse wrote:    
> > > > Allan McRae <allan at archlinux.org> on Thu, 2022/01/13 23:52:      
> > > >> I have had a spare 5 minutes...   you need to add a CacheServer
> > > >> global option to pacman.conf and wire that into pacman & libalpm.
> > > >> Then when forming the list of Servers in a download payload for a
> > > >> package, you need to add that server at the top and note that it is
> > > >> a cache server. 
> > > > 
> > > > Sure, so we want to put cache and regular servers in a single list?
> > > > 
> > > > Currently this uses alpm_list_t, which is a doubly linked list. The
> > > > servers are added as 'char *' there. Do we want to add a struct for
> > > > servers which adds a field for storing its type?
> > > > 
> > > > typedef struct _alpm_server_t {
> > > > 	int cache;
> > > > 	char *server;
> > > > } alpm_server_t;
> > > >       
> > > 
> > > Having not looked at this in detail... my initial reaction is no. 
> > > Assuming we allow a single CacheServer, would it be more efficient to 
> > > add the field into the payload struct?    
> > 
> > Why limit to just one cache server? For me (with pacredir) this would be
> > sufficient, but I guess others will complain:
> > Having several servers in a network sharing their cache you could add all
> > of them to the configuration:
> > 
> > [core]
> > CacheServer = http://server-a.localdomain/
> > CacheServer = http://server-b.localdomain/
> > Server = ...  
> 
> Currently we have a 'struct server_error_count':
> 
> struct server_error_count {
>         char server[HOSTNAME_SIZE];
>         unsigned int errors;
> };
> 
> How about implementing 'struct cache_servers'?
> 
> struct server_error_count {
>         char server[HOSTNAME_SIZE];
>         unsigned int errors;
> };
> 
> Or modify to hold both options?
> 
> struct server_opts {
>         char server[HOSTNAME_SIZE];
> 	unsigned int cache;
>         unsigned int errors;
> };

A friendly ping on this topic...
Any more thoughts?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20220119/6b3b6687/attachment.sig>


More information about the pacman-dev mailing list