summaryrefslogtreecommitdiffstats
path: root/agent/cache.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2004-08-20 15:43:14 +0200
committerWerner Koch <wk@gnupg.org>2004-08-20 15:43:14 +0200
commitebaba6bdab5cff7a7208106454cf9f0af45b69e1 (patch)
treee420f05b55f81e2e7fbfdfc37359c43fdd8a892b /agent/cache.c
parent(start_pinentry): Use a timeout for the pinentry lock. (diff)
downloadgnupg2-ebaba6bdab5cff7a7208106454cf9f0af45b69e1.tar.xz
gnupg2-ebaba6bdab5cff7a7208106454cf9f0af45b69e1.zip
* gpg-agent.c: New option --max-cache-ttl. Suggested by Alexander
Belopolsky. * cache.c (housekeeping): Use it here instead of the hardwired default of 1 hour.
Diffstat (limited to 'agent/cache.c')
-rw-r--r--agent/cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/agent/cache.c b/agent/cache.c
index b6ab55085..8017b1414 100644
--- a/agent/cache.c
+++ b/agent/cache.c
@@ -103,10 +103,11 @@ housekeeping (void)
that the user has to enter it from time to time. We do this every hour */
for (r=thecache; r; r = r->next)
{
- if (!r->lockcount && r->pw && r->created + 60*60 < current)
+ if (!r->lockcount && r->pw && r->created + opt.max_cache_ttl < current)
{
if (DBG_CACHE)
- log_debug (" expired `%s' (1h after creation)\n", r->key);
+ log_debug (" expired `%s' (%lus after creation)\n",
+ r->key, opt.max_cache_ttl);
release_data (r->pw);
r->pw = NULL;
r->accessed = current;