Home GnuPG
Diffusion GnuPG 48e7977709b6

dirmngr: Improve domaininfo cache update algorithm.

Description

dirmngr: Improve domaininfo cache update algorithm.

* dirmngr/domaininfo.c (struct domaininfo_s): Add field keepmark.
(insert_or_update): Implement new update algorithm.

The old algorithm limited the length of a bucket chain by purging the
last 50% or the entries. Thus the first domains entered into the
cache were never purged. The new algorithm is a bit better: It also
limits the chain length on overflow to 50% but tries to keep the
entries indicating that a WKD is available in the cache. If there is
still space to keep more, those which clearly do not support WKD are
also kept.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Apr 2 2019, 1:22 PM
Parents
rG0a30ce036a61: dirmngr: Better error code for http status 413.
Branches
Unknown
Tags
Unknown