[svn] dirmngr - r313 - trunk/src
svn author wk
cvs at cvs.gnupg.org
Tue May 26 17:12:56 CEST 2009
Author: wk
Date: 2009-05-26 17:12:55 +0200 (Tue, 26 May 2009)
New Revision: 313
Modified:
trunk/src/ChangeLog
trunk/src/crlcache.c
trunk/src/dirmngr_ldap.c
trunk/src/ldap.c
Log:
Changed some diagnostics.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-04-03 09:26:08 UTC (rev 312)
+++ trunk/src/ChangeLog 2009-05-26 15:12:55 UTC (rev 313)
@@ -1,3 +1,10 @@
+2009-05-26 Werner Koch <wk at g10code.com>
+
+ * ldap.c (ldap_wrapper): Show reader object in diagnostics.
+ * crlcache.c (crl_cache_reload_crl): Ditto. Change debug messages
+ to regular diagnostics.
+ * dirmngr_ldap.c (print_ldap_entries): Add extra diagnostics.
+
2009-04-03 Werner Koch <wk at g10code.com>
* dirmngr.h (struct server_local_s): Move back to ...
Modified: trunk/src/crlcache.c
===================================================================
--- trunk/src/crlcache.c 2009-04-03 09:26:08 UTC (rev 312)
+++ trunk/src/crlcache.c 2009-05-26 15:12:55 UTC (rev 313)
@@ -2402,8 +2402,8 @@
/* Loop over all distribution points, get the CRLs and put them into
the cache. */
- if (DBG_X509)
- log_debug ("checking distribution points\n");
+ if (opt.verbose)
+ log_info ("checking distribution points\n");
seq = 0;
while ( !(err = ksba_cert_get_crl_dist_point (cert, seq++,
&distpoint,
@@ -2414,8 +2414,8 @@
if (!distpoint && !issuername)
{
- if (DBG_X509)
- log_debug ("no issuer name and no distribution point\n");
+ if (opt.verbose)
+ log_info ("no issuer name and no distribution point\n");
break; /* Not allowed; i.e. an invalid certificate. We give
up here and hope that the default method returns a
suitable CRL. */
@@ -2449,8 +2449,8 @@
any_dist_point = 1;
- if (DBG_X509)
- log_debug ("fetching CRL from `%s'\n", distpoint_uri);
+ if (opt.verbose)
+ log_info ("fetching CRL from `%s'\n", distpoint_uri);
err = crl_fetch (ctrl, distpoint_uri, &reader);
if (err)
{
@@ -2460,8 +2460,8 @@
continue; /* with the next name. */
}
- if (DBG_X509)
- log_debug ("inserting CRL\n");
+ if (opt.verbose)
+ log_info ("inserting CRL (reader %p)\n", reader);
err = crl_cache_insert (ctrl, distpoint_uri, reader);
if (err)
{
@@ -2493,8 +2493,8 @@
/* If we did not found any distpoint, try something reasonable. */
if (!any_dist_point )
{
- if (DBG_X509)
- log_debug ("no distribution point - trying issuer name\n");
+ if (opt.verbose)
+ log_info ("no distribution point - trying issuer name\n");
if (reader)
{
@@ -2510,18 +2510,18 @@
goto leave;
}
- if (DBG_X509)
- log_debug ("fetching CRL from default location\n");
+ if (opt.verbose)
+ log_info ("fetching CRL from default location\n");
err = crl_fetch_default (ctrl, issuer, &reader);
if (err)
{
- log_error (_("crl_fetch via issuer failed: %s\n"),
+ log_error ("crl_fetch via issuer failed: %s\n",
gpg_strerror (err));
goto leave;
}
- if (DBG_X509)
- log_debug ("inserting CRL\n");
+ if (opt.verbose)
+ log_info ("inserting CRL (reader %p)\n", reader);
err = crl_cache_insert (ctrl, "default location(s)", reader);
if (err)
{
Modified: trunk/src/dirmngr_ldap.c
===================================================================
--- trunk/src/dirmngr_ldap.c 2009-04-03 09:26:08 UTC (rev 312)
+++ trunk/src/dirmngr_ldap.c 2009-05-26 15:12:55 UTC (rev 313)
@@ -388,7 +388,14 @@
}
if (opt.verbose)
- log_info (_("found attribute `%s'\n"), attr);
+ {
+ log_info (_("found attribute `%s'\n"), attr);
+ if (opt.verbose > 1)
+ for (idx=0; values[idx]; idx++)
+ log_info (" length[%d]=%d\n",
+ idx, (int)values[0]->bv_len);
+
+ }
if (opt.multi)
{ /* Write attribute marker. */
@@ -488,6 +495,9 @@
ber_free (berctx, 0);
}
+ if (opt.verbose > 1 && any)
+ log_info ("result has been printed\n");
+
return any?0:-1;
}
Modified: trunk/src/ldap.c
===================================================================
--- trunk/src/ldap.c 2009-04-03 09:26:08 UTC (rev 312)
+++ trunk/src/ldap.c 2009-05-26 15:12:55 UTC (rev 313)
@@ -466,7 +466,7 @@
size_t nleft = count;
/* FIXME: We might want to add some internal buffering because the
- ksba code does not not any buffering for itself (because a ksba
+ ksba code does not do any buffering for itself (because a ksba
reader may be detached from another stream to read other data and
the it would be cumbersome to get back already buffered
stuff). */
@@ -590,7 +590,7 @@
only viable solutions are either to have another thread
responsible for logging the messages or to add an option to the
wrapper modules to the logging on its own. Given that we anyway
- need a way to rip the child process and is best done using a
+ need a way to rip the child process and this best done using a
general ripping thread, that thread can do the logging too. */
*reader = NULL;
@@ -666,7 +666,8 @@
ctx->next = wrapper_list;
wrapper_list = ctx;
if (opt.verbose)
- log_info (_("ldap wrapper %d started\n"), (int)ctx->pid);
+ log_info ("ldap wrapper %d started (reader %p)\n",
+ (int)ctx->pid, ctx->reader);
/* Need to wait for the first byte so we are able to detect an empty
output and not let the consumer see an EOF without further error
@@ -696,7 +697,7 @@
/* Perform an LDAP query. Returns an gpg error code or 0 on success.
- The function returns a new stream at R_FP. */
+ The function returns a new reader object at READER. */
static gpg_error_t
run_ldap_wrapper (ctrl_t ctrl,
int ignore_timeout,
@@ -780,7 +781,7 @@
/* Perform a LDAP query using a given URL. On success a new ksba
- reader is returned. If HOST or PORT ar not 0, they are used to
+ reader is returned. If HOST or PORT are not 0, they are used to
override the values from the URL. */
gpg_error_t
url_fetch_ldap (ctrl_t ctrl, const char *url, const char *host, int port,
@@ -789,7 +790,7 @@
gpg_error_t err;
err = run_ldap_wrapper (ctrl,
- 1, /* Ignore explicit timeout because CRLS
+ 1, /* Ignore explicit timeout because CRLs
might be very large. */
0,
opt.ldap_proxy,
More information about the Gnupg-commits
mailing list