GNUPG-1-9-BRANCH gnupg/agent (ChangeLog cache.c)

cvs user wk cvs at cvs.gnupg.org
Tue Jan 4 09:27:08 CET 2005


    Date: Tuesday, January 4, 2005 @ 09:33:20
  Author: wk
    Path: /cvs/gnupg/gnupg/agent
     Tag: GNUPG-1-9-BRANCH

Modified: ChangeLog cache.c

(agent_put_cache): Fix the test for using the default
TTL.


-----------+
 ChangeLog |    5 +++++
 cache.c   |    9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)


Index: gnupg/agent/ChangeLog
diff -u gnupg/agent/ChangeLog:1.59.2.54 gnupg/agent/ChangeLog:1.59.2.55
--- gnupg/agent/ChangeLog:1.59.2.54	Tue Dec 21 20:05:15 2004
+++ gnupg/agent/ChangeLog	Tue Jan  4 09:33:20 2005
@@ -1,3 +1,8 @@
+2005-01-04  Werner Koch  <wk at g10code.com>
+
+	* cache.c (agent_put_cache): Fix the test for using the default
+	TTL.
+
 2004-12-21  Werner Koch  <wk at g10code.com>
 
 	* preset-passphrase.c (preset_passphrase): Handle --passphrase.
Index: gnupg/agent/cache.c
diff -u gnupg/agent/cache.c:1.10.2.2 gnupg/agent/cache.c:1.10.2.3
--- gnupg/agent/cache.c:1.10.2.2	Tue Dec 21 20:05:15 2004
+++ gnupg/agent/cache.c	Tue Jan  4 09:33:20 2005
@@ -39,7 +39,7 @@
   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 @@
 /* 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;




More information about the Gnupg-commits mailing list