diff options
author | Werner Koch <wk@gnupg.org> | 2002-09-26 09:10:56 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2002-09-26 09:10:56 +0200 |
commit | 2d432afff653239ef73c97fdecfff2df1622c62d (patch) | |
tree | 3a79b85af1e07965da9043f43dc7e23c39187988 /agent/cache.c | |
parent | * Makefile.am: Link gpg with EGDLIBS (i.e. NETLIBS) as EGD uses sockets. (diff) | |
download | gnupg2-2d432afff653239ef73c97fdecfff2df1622c62d.tar.xz gnupg2-2d432afff653239ef73c97fdecfff2df1622c62d.zip |
* gpg-agent.c (handle_signal): Flush cache on SIGHUP.
* cache.c (agent_flush_cache): New.
* gpg-agent.c, agent.h: Add --keep-display and --keep-tty.
* query.c (start_pinentry): Implement them. The option passing
needs more thoughts.
Diffstat (limited to 'agent/cache.c')
-rw-r--r-- | agent/cache.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/agent/cache.c b/agent/cache.c index 4b18ad30f..8f5bf9d3d 100644 --- a/agent/cache.c +++ b/agent/cache.c @@ -150,6 +150,35 @@ housekeeping (void) } +void +agent_flush_cache (void) +{ + ITEM r; + + if (DBG_CACHE) + log_debug ("agent_flush_cache\n"); + + for (r=thecache; r; r = r->next) + { + if (!r->lockcount && r->pw) + { + if (DBG_CACHE) + log_debug (" flushing `%s'\n", r->key); + release_data (r->pw); + r->pw = NULL; + r->accessed = 0; + } + else if (r->lockcount && r->pw) + { + if (DBG_CACHE) + log_debug (" marked `%s' for flushing\n", r->key); + r->accessed = 0; + r->ttl = 0; + } + } +} + + /* Store DATA of length DATALEN in the cache under KEY and mark it with a maximum lifetime of TTL seconds. If there is already data |