diff options
author | Werner Koch <[email protected]> | 2010-07-23 16:16:14 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-07-23 16:16:14 +0000 |
commit | a22c38baad4113ce477b2e312e0bec365c0bd6b3 (patch) | |
tree | bfa3cedf6beb152420e22687eed1f29bad758ab9 /dirmngr/dirmngr.c | |
parent | . (diff) | |
download | gnupg-a22c38baad4113ce477b2e312e0bec365c0bd6b3.tar.gz gnupg-a22c38baad4113ce477b2e312e0bec365c0bd6b3.zip |
Some work on the dirmngr
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r-- | dirmngr/dirmngr.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 5a913905d..52efb9be4 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -54,6 +54,7 @@ #include "misc.h" #include "ldapserver.h" #include "asshelp.h" +#include "ldap-wrapper.h" /* The plain Windows version uses the windows service system. For example to start the service you may use "sc start dirmngr". @@ -393,32 +394,6 @@ wrong_args (const char *text) } -/* Helper to start the reaper thread for the ldap wrapper. */ -static void -launch_reaper_thread (void) -{ - static int done; - pth_attr_t tattr; - - if (done) - return; - done = 1; - - tattr = pth_attr_new(); - pth_attr_set (tattr, PTH_ATTR_JOINABLE, 0); - pth_attr_set (tattr, PTH_ATTR_STACK_SIZE, 256*1024); - pth_attr_set (tattr, PTH_ATTR_NAME, "ldap-reaper"); - - if (!pth_spawn (tattr, ldap_wrapper_thread, NULL)) - { - log_error (_("error spawning ldap wrapper reaper thread: %s\n"), - strerror (errno) ); - dirmngr_exit (1); - } - pth_attr_destroy (tattr); -} - - /* Helper to stop the reaper thread for the ldap wrapper. */ static void shutdown_reaper (void) @@ -938,7 +913,7 @@ main (int argc, char **argv) log_debug ("... okay\n"); } - launch_reaper_thread (); + ldap_wrapper_launch_thread (); cert_cache_init (); crl_cache_init (); start_command_handler (ASSUAN_INVALID_FD); @@ -1101,7 +1076,7 @@ main (int argc, char **argv) } #endif - launch_reaper_thread (); + ldap_wrapper_launch_thread (); cert_cache_init (); crl_cache_init (); #ifdef USE_W32_SERVICE @@ -1127,7 +1102,7 @@ main (int argc, char **argv) /* Just list the CRL cache and exit. */ if (argc) wrong_args ("--list-crls"); - launch_reaper_thread (); + ldap_wrapper_launch_thread (); crl_cache_init (); crl_cache_list (es_stdout); } @@ -1138,7 +1113,7 @@ main (int argc, char **argv) memset (&ctrlbuf, 0, sizeof ctrlbuf); dirmngr_init_default_ctrl (&ctrlbuf); - launch_reaper_thread (); + ldap_wrapper_launch_thread (); cert_cache_init (); crl_cache_init (); if (!argc) @@ -1160,7 +1135,7 @@ main (int argc, char **argv) memset (&ctrlbuf, 0, sizeof ctrlbuf); dirmngr_init_default_ctrl (&ctrlbuf); - launch_reaper_thread (); + ldap_wrapper_launch_thread (); cert_cache_init (); crl_cache_init (); rc = crl_fetch (&ctrlbuf, argv[0], &reader); |