Debug message cleanups.

Fixed passphrase caching.
This commit is contained in:
Werner Koch 2002-04-27 13:49:40 +00:00
parent a2176634ae
commit 8460fb4a73
5 changed files with 22 additions and 8 deletions

View File

@ -1,3 +1,12 @@
2002-04-26 Werner Koch <wk@gnupg.org>
* cache.c (agent_put_cache): Reinitialize the creation time and
the ttl when reusing a slot.
* call-scd.c (start_scd): Print debug messages only with debug
flags set.
* query.c (start_pinentry): Ditto.
2002-04-25 Marcus Brinkmann <marcus@g10code.de> 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* agent.h (agent_get_confirmation): Replace paramter prompt with * agent.h (agent_get_confirmation): Replace paramter prompt with

View File

@ -139,7 +139,7 @@ housekeeping (void)
/* Store DATA of length DATALEN in the cache under KEY and mark it /* Store DATA of length DATALEN in the cache under KEY and mark it
with a maximum lifetime of TTL seconds. If tehre is already data 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 under this key, it will be replaced. Using a DATA of NULL deletes
the entry */ the entry */
int int
@ -170,6 +170,8 @@ agent_put_cache (const char *key, const char *data, int ttl)
} }
if (data) if (data)
{ {
r->created = r->accessed = time (NULL);
r->ttl = ttl;
r->pw = new_data (data, strlen (data)+1); r->pw = new_data (data, strlen (data)+1);
if (!r->pw) if (!r->pw)
log_error ("out of core while allocating new cache item\n"); log_error ("out of core while allocating new cache item\n");

View File

@ -136,7 +136,8 @@ start_scd (void)
expected to tun as a single-thread (or may be in expected to tun as a single-thread (or may be in
future using libpth) */ future using libpth) */
log_debug ("no running SCdaemon - starting it\n"); if (opt.verbose)
log_info ("no running SCdaemon - starting it\n");
if (fflush (NULL)) if (fflush (NULL))
{ {
@ -166,7 +167,8 @@ start_scd (void)
} }
scd_ctx = ctx; scd_ctx = ctx;
log_debug ("connection to SCdaemon established\n"); if (DBG_ASSUAN)
log_debug ("connection to SCdaemon established\n");
return 0; return 0;
} }

View File

@ -165,7 +165,7 @@ i18n_init (void)
/* Use by gcry for logging */ /* Used by gcry for logging */
static void static void
my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr) my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
{ {

View File

@ -63,8 +63,8 @@ start_pinentry (void)
expected to tun as a single-thread (or may be in expected to tun as a single-thread (or may be in
future using libpth) */ future using libpth) */
if (opt.verbose)
log_debug ("no running PIN Entry - starting it\n"); log_info ("no running PIN Entry - starting it\n");
if (fflush (NULL)) if (fflush (NULL))
{ {
@ -99,8 +99,9 @@ start_pinentry (void)
return seterr (No_PIN_Entry); return seterr (No_PIN_Entry);
} }
entry_ctx = ctx; entry_ctx = ctx;
log_debug ("connection to PIN entry established\n"); if (DBG_ASSUAN)
log_debug ("connection to PIN entry established\n");
rc = assuan_transact (entry_ctx, rc = assuan_transact (entry_ctx,
opt.no_grab? "OPTION no-grab":"OPTION grab", opt.no_grab? "OPTION no-grab":"OPTION grab",