summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2005-01-04 09:33:20 +0100
committerWerner Koch <wk@gnupg.org>2005-01-04 09:33:20 +0100
commit2f0c8ff6fbd71472604de387592e0181d6bfd8af (patch)
tree501c097df46f252ec8225d92b3cae84d9bbce69f /agent
parent(send_pinentry_environment): Fixed changed from (diff)
downloadgnupg2-2f0c8ff6fbd71472604de387592e0181d6bfd8af.tar.xz
gnupg2-2f0c8ff6fbd71472604de387592e0181d6bfd8af.zip
(agent_put_cache): Fix the test for using the default
TTL.
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog5
-rw-r--r--agent/cache.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index d835c8e60..fa450dfdb 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-04 Werner Koch <wk@g10code.com>
+
+ * cache.c (agent_put_cache): Fix the test for using the default
+ TTL.
+
2004-12-21 Werner Koch <wk@g10code.com>
* preset-passphrase.c (preset_passphrase): Handle --passphrase.
diff --git a/agent/cache.c b/agent/cache.c
index b6762edd0..18aa7653b 100644
--- a/agent/cache.c
+++ b/agent/cache.c
@@ -39,7 +39,7 @@ struct cache_item_s {
ITEM next;
time_t created;
time_t accessed;
- int ttl; /* max. lifetime given in seonds, -1 one means infinite */
+ int ttl; /* max. lifetime given in seconds, -1 one means infinite */
int lockcount;
struct secret_data_s *pw;
char key[1];
@@ -185,17 +185,18 @@ agent_flush_cache (void)
/* 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
under this key, it will be replaced. Using a DATA of NULL deletes
- the entry */
+ the entry. A TTL of 0 is replaced by the default TTL and a TTL of
+ -1 set infinite timeout. */
int
agent_put_cache (const char *key, const char *data, int ttl)
{
ITEM r;
if (DBG_CACHE)
- log_debug ("agent_put_cache `%s'\n", key);
+ log_debug ("agent_put_cache `%s' requested ttl=%d\n", key, ttl);
housekeeping ();
- if (ttl == 1)
+ if (!ttl)
ttl = opt.def_cache_ttl;
if (!ttl)
return 0;