Home GnuPG
Diffusion GnuPG 92de0387f04b

agent: Introduce management of timer to expire cache entries.

Description

agent: Introduce management of timer to expire cache entries.

* agent/cache.c (struct timer_s): New.
(struct cache_item_s): Add a member filed T for timer.
(the_timer_list, the_timer_list_new): New.
(insert_to_timer_list_new, insert_to_timer_list): New.
(remove_from_timer_list, remove_from_timer_list_new): New.
(housekeeping): Remove.
(compute_expiration, update_expiration): New.
(do_expire): New.
(TIMERTICK_INTERVAL): Remove.
(agent_cache_expiration): Use timer list to manage the expiration
of cache entries.
(agent_flush_cache): Call update_expiration when needed.
(agent_put_cache): Don't call housekeeping any more, but
update_expiration for an entry in question.
(agent_get_cache): Likewise.
  • GnuPG-bug-id: T6681
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>