dirmngr/src (ChangeLog ldap.c server.c)

cvs user wk cvs at cvs.gnupg.org
Wed Apr 20 18:47:06 CEST 2005


    Date: Wednesday, April 20, 2005 @ 19:03:56
  Author: wk
    Path: /cvs/dirmngr/dirmngr/src

Modified: ChangeLog ldap.c server.c

(ldap_wrapper_wait_connections): Set a shutdown flag.
(ldap_wrapper_thread): Handle shutdown in a special way.


-----------+
 ChangeLog |   10 ++++++++++
 ldap.c    |   14 +++++++++-----
 server.c  |   15 +++++++++------
 3 files changed, 28 insertions(+), 11 deletions(-)


Index: dirmngr/src/ChangeLog
diff -u dirmngr/src/ChangeLog:1.47 dirmngr/src/ChangeLog:1.48
--- dirmngr/src/ChangeLog:1.47	Mon Apr 18 12:37:53 2005
+++ dirmngr/src/ChangeLog	Wed Apr 20 19:03:56 2005
@@ -1,3 +1,13 @@
+2005-04-20  Werner Koch  <wk at g10code.com>
+
+	* ldap.c (ldap_wrapper_wait_connections): Set a shutdown flag.
+	(ldap_wrapper_thread): Handle shutdown in a special way.
+
+2005-04-19  Werner Koch  <wk at g10code.com>
+
+	* server.c (get_cert_local, get_issuing_cert_local) 
+	(get_cert_local_ski): Bail out if called without a local context.
+
 2005-04-18  Werner Koch  <wk at g10code.com>
 
 	* certcache.c (find_issuing_cert): Fixed last resort method which
Index: dirmngr/src/ldap.c
diff -u dirmngr/src/ldap.c:1.48 dirmngr/src/ldap.c:1.49
--- dirmngr/src/ldap.c:1.48	Thu Apr 14 13:58:29 2005
+++ dirmngr/src/ldap.c	Wed Apr 20 19:03:56 2005
@@ -65,7 +65,7 @@
 };
 
 
-/* To keep track of the LDAp wrapper state we use this structure.  */
+/* To keep track of the LDAP wrapper state we use this structure.  */
 struct wrapper_context_s
 {
   struct wrapper_context_s *next;
@@ -95,6 +95,9 @@
    finished processes. */
 static struct wrapper_context_s *wrapper_list;
 
+/* We need to know whether we are shutting down the process */
+static int shutting_down;
+
 
 /* Prototypes.  */
 static gpg_error_t read_buffer (ksba_reader_t reader,
@@ -343,10 +346,10 @@
 
       /* Use a separate loop to check whether ready marked wrappers
          may be removed.  We may only do so if the ksba reader object
-         is not anymore in use. */
+         is not anymore in use or we are in shutdown state.  */
      again:
       for (ctx_prev=NULL, ctx=wrapper_list; ctx; ctx_prev=ctx, ctx=ctx->next)
-        if (ctx->ready && !ctx->reader)
+        if (ctx->ready && (!ctx->reader || shutting_down))
           {
             if (ctx_prev)
               ctx_prev->next = ctx->next;
@@ -368,6 +371,7 @@
 void
 ldap_wrapper_wait_connections ()
 {
+  shutting_down = 1;
   while (wrapper_list)
     pth_yield (NULL);
 }
@@ -406,7 +410,7 @@
       }
 }
 
-/* Cleanup all resources hel by the connection associated with
+/* Cleanup all resources held by the connection associated with
    CTRL.  This is used after a cancel to kill running wrappers.  */
 void
 ldap_wrapper_connection_cleanup (ctrl_t ctrl)
@@ -1302,7 +1306,7 @@
        
           if (is_cms)
             {
-              /* The certificate needs to be parsed from CMS data.  Read */
+              /* The certificate needs to be parsed from CMS data. */
               ksba_cms_t cms;
               ksba_stop_reason_t stopreason;
               int i;
Index: dirmngr/src/server.c
diff -u dirmngr/src/server.c:1.49 dirmngr/src/server.c:1.50
--- dirmngr/src/server.c:1.49	Mon Apr 18 12:37:53 2005
+++ dirmngr/src/server.c	Wed Apr 20 19:03:56 2005
@@ -165,9 +165,10 @@
 ksba_cert_t 
 get_cert_local (ctrl_t ctrl, const char *name)
 {
-  if (!ctrl || !ctrl->server_local->assuan_ctx)
+  if (!ctrl || !ctrl->server_local || !ctrl->server_local->assuan_ctx)
     {
-      log_debug ("get_cert_local called w/o context\n");
+      if (opt.debug)
+        log_debug ("get_cert_local called w/o context\n");
       return NULL;
     }
   return do_get_cert_local (ctrl, name, "SENDCERT");
@@ -184,9 +185,10 @@
 ksba_cert_t 
 get_issuing_cert_local (ctrl_t ctrl, const char *name)
 {
-  if (!ctrl || !ctrl->server_local->assuan_ctx)
+  if (!ctrl || !ctrl->server_local || !ctrl->server_local->assuan_ctx)
     {
-      log_debug ("get_issuing_cert_local called w/o context\n");
+      if (opt.debug)
+        log_debug ("get_issuing_cert_local called w/o context\n");
       return NULL;
     }
   return do_get_cert_local (ctrl, name, "SENDISSUERCERT");
@@ -204,9 +206,10 @@
   ksba_cert_t cert;
   char *hexkeyid;
 
-  if (!ctrl || !ctrl->server_local->assuan_ctx)
+  if (!ctrl || !ctrl->server_local || !ctrl->server_local->assuan_ctx)
     {
-      log_debug ("get_cert_local_ski called w/o context\n");
+      if (opt.debug)
+        log_debug ("get_cert_local_ski called w/o context\n");
       return NULL;
     }
   if (!name || !keyid)




More information about the Gnupg-commits mailing list