[svn] dirmngr - r287 - in trunk: . src
svn author marcus
cvs at cvs.gnupg.org
Wed Feb 13 13:51:44 CET 2008
Author: marcus
Date: 2008-02-13 13:51:43 +0100 (Wed, 13 Feb 2008)
New Revision: 287
Modified:
trunk/TODO
trunk/src/ChangeLog
trunk/src/crlcache.c
trunk/src/exechelp.c
trunk/src/exechelp.h
trunk/src/ldap.c
Log:
2008-02-13 Marcus Brinkmann <marcus at g10code.de>
* crlcache.c (finish_sig_check): Call gcry_md_stop_debug.
* exechelp.h (dirmngr_release_process): New prototype.
* exechelp.c (dirmngr_release_process): New function.
* ldap.c (ldap_wrapper_thread): Release pid.
(destroy_wrapper): Likewise.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2008-02-13 11:48:38 UTC (rev 286)
+++ trunk/src/ChangeLog 2008-02-13 12:51:43 UTC (rev 287)
@@ -1,5 +1,11 @@
2008-02-13 Marcus Brinkmann <marcus at g10code.de>
+ * crlcache.c (finish_sig_check): Call gcry_md_stop_debug.
+ * exechelp.h (dirmngr_release_process): New prototype.
+ * exechelp.c (dirmngr_release_process): New function.
+ * ldap.c (ldap_wrapper_thread): Release pid.
+ (destroy_wrapper): Likewise.
+
* dirmngr.c (launch_reaper_thread): Destroy tattr.
(handle_connections): Likewise.
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-02-13 11:48:38 UTC (rev 286)
+++ trunk/TODO 2008-02-13 12:51:43 UTC (rev 287)
@@ -29,3 +29,9 @@
For some purposes (e.g. Poldi) it might make sense to allow the
caller to restrict what root certificates are to be used for the
chain validation.
+
+* Windows port (unknown if these bugs also occur in GNU/Linux):
+ We are leaking some events under load, probably a bug in w32-pth.
+ When hashing debugging is enabled, we leak file handles for the
+ dbgmd crl files. May be a bug in gcrypt.
+
Modified: trunk/src/crlcache.c
===================================================================
--- trunk/src/crlcache.c 2008-02-13 11:48:38 UTC (rev 286)
+++ trunk/src/crlcache.c 2008-02-13 12:51:43 UTC (rev 287)
@@ -1441,7 +1441,7 @@
return err;
}
if (DBG_HASHING)
- gcry_md_start_debug (*md, "crl");
+ gcry_md_debug (*md, "crl");
ksba_crl_set_hash_function (crl, HASH_FNC, *md);
return 0;
@@ -1466,6 +1466,8 @@
int i;
gcry_md_final (md);
+ if (DBG_HASHING)
+ gcry_md_debug (md, NULL);
/* Get and convert the signature value. */
sigval = ksba_crl_get_sig_val (crl);
Modified: trunk/src/exechelp.c
===================================================================
--- trunk/src/exechelp.c 2008-02-13 11:48:38 UTC (rev 286)
+++ trunk/src/exechelp.c 2008-02-13 12:51:43 UTC (rev 287)
@@ -511,9 +511,21 @@
dirmngr_kill_process (pid_t pid)
{
#ifdef HAVE_W32_SYSTEM
- /* FIXME: Implement something. */
+ /* FIXME: Implement something. TerminateProcess may compromise the
+ state of global data held by DLLs, but seems our best (or only?)
+ shot. */
return 0;
#else
return kill (pid, SIGTERM);
#endif
}
+
+
+gpg_error_t
+dirmngr_release_process (pid_t pid)
+{
+#ifdef HAVE_W32_SYSTEM
+ CloseHandle (pid_to_handle (pid));
+#endif
+ return 0;
+}
Modified: trunk/src/exechelp.h
===================================================================
--- trunk/src/exechelp.h 2008-02-13 11:48:38 UTC (rev 286)
+++ trunk/src/exechelp.h 2008-02-13 12:51:43 UTC (rev 287)
@@ -1,5 +1,5 @@
/* exechelp.h - fork and exec helpers
- * Copyright (C) 2004, 2007 g10 Code GmbH
+ * Copyright (C) 2004, 2007, 2008 g10 Code GmbH
*
* This file is part of DirMngr.
*
@@ -39,4 +39,7 @@
/* Kill the program PID. */
gpg_error_t dirmngr_kill_process (pid_t pid);
+/* Release the PID. */
+gpg_error_t dirmngr_release_process (pid_t pid);
+
#endif /* DIRMNGR_EXECHELP_H */
Modified: trunk/src/ldap.c
===================================================================
--- trunk/src/ldap.c 2008-02-13 11:48:38 UTC (rev 286)
+++ trunk/src/ldap.c 2008-02-13 12:51:43 UTC (rev 287)
@@ -167,7 +167,10 @@
destroy_wrapper (struct wrapper_context_s *ctx)
{
if (ctx->pid != (pid_t)(-1))
- dirmngr_kill_process (ctx->pid);
+ {
+ dirmngr_kill_process (ctx->pid);
+ dirmngr_release_process (ctx->pid);
+ }
ksba_reader_release (ctx->reader);
if (ctx->fd != -1)
pth_close (ctx->fd);
@@ -345,6 +348,7 @@
_("ldap wrapper %d ready: timeout\n") :
_("ldap wrapper %d ready"), (int)ctx->pid);
ctx->ready = 1;
+ dirmngr_release_process (ctx->pid);
ctx->pid = (pid_t)(-1);
}
else if (gpg_err_code (err) != GPG_ERR_TIMEOUT)
More information about the Gnupg-commits
mailing list