diff options
author | Werner Koch <[email protected]> | 2005-06-16 08:12:03 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2005-06-16 08:12:03 +0000 |
commit | deeba405a9a5868ea478db5003be6335ab9aac6f (patch) | |
tree | d61d720258fd571ec81a3d3e5d776320b7b1d796 /agent/cache.c | |
parent | New debugging optionhs, updates to the manual. (diff) | |
download | gnupg-deeba405a9a5868ea478db5003be6335ab9aac6f.tar.gz gnupg-deeba405a9a5868ea478db5003be6335ab9aac6f.zip |
gcc-4 defaults forced me to edit many many files to get rid of the
char * vs. unsigned char * warnings. The GNU coding standards used to
say that these mismatches are okay and better than a bunch of casts.
Obviously this has changed now.
Diffstat (limited to '')
-rw-r--r-- | agent/cache.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/agent/cache.c b/agent/cache.c index a032b4fa7..32b6ac0c7 100644 --- a/agent/cache.c +++ b/agent/cache.c @@ -103,10 +103,17 @@ housekeeping (void) } /* Second, make sure that we also remove them based on the created stamp so - that the user has to enter it from time to time. We do this every hour */ + that the user has to enter it from time to time. */ for (r=thecache; r; r = r->next) { - if (!r->lockcount && r->pw && r->created + opt.max_cache_ttl < current) + unsigned long maxttl; + + switch (r->cache_mode) + { + case CACHE_MODE_SSH: maxttl = opt.max_cache_ttl_ssh; break; + default: maxttl = opt.max_cache_ttl; break; + } + if (!r->lockcount && r->pw && r->created + maxttl < current) { if (DBG_CACHE) log_debug (" expired `%s' (%lus after creation)\n", @@ -203,10 +210,11 @@ agent_put_cache (const char *key, cache_mode_t cache_mode, if (!ttl) { - if (cache_mode == CACHE_MODE_SSH) - ttl = opt.def_cache_ttl_ssh; - else - ttl = opt.def_cache_ttl; + switch(cache_mode) + { + case CACHE_MODE_SSH: ttl = opt.def_cache_ttl_ssh; break; + default: ttl = opt.def_cache_ttl; break; + } } if (!ttl || cache_mode == CACHE_MODE_IGNORE) return 0; |