[svn] GnuPG - r5290 - in trunk: agent common g10 g13 scd sm

svn author wk cvs at cvs.gnupg.org
Thu Mar 11 13:34:12 CET 2010


Author: wk
Date: 2010-03-11 13:34:11 +0100 (Thu, 11 Mar 2010)
New Revision: 5290

Modified:
   trunk/agent/ChangeLog
   trunk/agent/call-scd.c
   trunk/agent/gpg-agent.c
   trunk/common/ChangeLog
   trunk/common/asshelp.c
   trunk/common/asshelp.h
   trunk/common/estream.c
   trunk/common/logging.c
   trunk/common/logging.h
   trunk/common/miscellaneous.c
   trunk/g10/ChangeLog
   trunk/g10/gpg.c
   trunk/g10/server.c
   trunk/g13/ChangeLog
   trunk/g13/g13.c
   trunk/g13/server.c
   trunk/scd/ChangeLog
   trunk/scd/command.c
   trunk/scd/scdaemon.c
   trunk/sm/ChangeLog
   trunk/sm/gpgsm.c
   trunk/sm/server.c
Log:
Use a custom log handler for libassuan.


Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/agent/ChangeLog	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1,3 +1,12 @@
+2010-03-11  Werner Koch  <wk at g10code.com>
+
+	* gpg-agent.c: Include "asshelp.h".
+	(main): Remove assuan_set_assuan_log_prefix.  Add
+	assuan_set_log_cb.
+	(handle_signal): Disable pth ctrl dumping.
+	(parse_rereadable_options, main): Remove assuan_set_assuan_log_stream.
+	* call-scd.c (start_scd): Remove assuan_set_log_stream.
+
 2010-03-10  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (common_libs): Remove libjnlib.a.

Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/ChangeLog	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1,3 +1,11 @@
+2010-03-11  Werner Koch  <wk at g10code.com>
+
+	* estream.c (es_setvbuf): Fix parameter check.
+	(es_set_buffering): Allow a SIZE of 0.
+	* asshelp.c (setup_libassuan_logging, my_libassuan_log_handler): New.
+	* logging.c (do_logv): Add arg IGNORE_ARG_PTR.  Change all callers.
+	(log_string): New.
+
 2010-03-10  Werner Koch  <wk at g10code.com>
 
 	* estream.c (es_func_fp_read, es_func_fp_write, es_func_fp_seek)

Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/g10/ChangeLog	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1,3 +1,10 @@
+2010-03-11  Werner Koch  <wk at g10code.com>
+
+	* gpg.c: Include "asshelp.h".
+	(main): Remove assuan_set_assuan_log_prefix.  Add
+	assuan_set_log_cb.
+	* server.c (gpg_server): Remove assuan_set_log_stream.
+
 2010-03-10  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (needed_libs): Remove libjnlib.a.

Modified: trunk/g13/ChangeLog
===================================================================
--- trunk/g13/ChangeLog	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/g13/ChangeLog	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1,4 +1,4 @@
-009-11-04  Werner Koch  <wk at g10code.com>
+2009-11-04  Werner Koch  <wk at g10code.com>
 
 	Under initial development - no need for a ChangeLog.
 

Modified: trunk/scd/ChangeLog
===================================================================
--- trunk/scd/ChangeLog	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/scd/ChangeLog	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1,3 +1,11 @@
+2010-03-11  Werner Koch  <wk at g10code.com>
+
+	* scdaemon.c: Include "asshelp.h".
+	(main): Remove assuan_set_assuan_log_prefix.  Add
+	assuan_set_log_cb.
+	(handle_signal): Disable pth ctrl dumping.
+	* command.c (scd_command_handler): Remove assuan_set_log_stream.
+
 2010-03-10  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (scdaemon_LDADD): Remove libjnlib.a.

Modified: trunk/sm/ChangeLog
===================================================================
--- trunk/sm/ChangeLog	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/sm/ChangeLog	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1,3 +1,10 @@
+2010-03-11  Werner Koch  <wk at g10code.com>
+
+	* gpgsm.c: Include "asshelp.h".
+	(main): Remove assuan_set_assuan_log_prefix.  Add
+	assuan_set_log_cb.
+	* server.c (gpgsm_server): Remove assuan_set_log_stream.
+
 2010-03-10  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (common_libs): Remove libjnlib.a.  Change order.

Modified: trunk/agent/call-scd.c
===================================================================
--- trunk/agent/call-scd.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/agent/call-scd.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -354,8 +354,6 @@
   if (opt.verbose)
     log_debug ("first connection to SCdaemon established\n");
 
-  if (DBG_ASSUAN)
-    assuan_set_log_stream (ctx, log_get_stream ());
 
   /* Get the name of the additional socket opened by scdaemon. */
   {

Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/agent/gpg-agent.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -49,6 +49,7 @@
 #include "setenv.h"
 #include "gc-opt-flags.h"
 #include "exechelp.h"
+#include "asshelp.h"
 
 enum cmd_and_opt_values 
 { aNull = 0,
@@ -494,8 +495,6 @@
           || strcmp (current_logfile, pargs->r.ret_str))
         {
           log_set_file (pargs->r.ret_str);
-	  if (DBG_ASSUAN)
-	    assuan_set_assuan_log_stream (log_get_stream ());
           xfree (current_logfile);
           current_logfile = xtrystrdup (pargs->r.ret_str);
         }
@@ -616,10 +615,10 @@
   malloc_hooks.realloc = gcry_realloc;
   malloc_hooks.free = gcry_free;
   assuan_set_malloc_hooks (&malloc_hooks);
-  assuan_set_assuan_log_prefix (log_get_prefix (NULL));
-  assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
+    assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
   assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
   assuan_sock_init ();
+  setup_libassuan_logging (&opt.debug);
 
   setup_libgcrypt_logging ();
   gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
@@ -946,8 +945,6 @@
                              |JNLIB_LOG_WITH_PID));
       current_logfile = xstrdup (logfile);
     }
-  if (DBG_ASSUAN)
-    assuan_set_assuan_log_stream (log_get_stream ());
 
   /* Make sure that we have a default ttyname. */
   if (!default_ttyname && ttyname (1))
@@ -1711,7 +1708,9 @@
       
     case SIGUSR1:
       log_info ("SIGUSR1 received - printing internal information:\n");
-      pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
+      /* Fixme: We need to see how to integrate pth dumping into our
+         logging system.  */
+      /* pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ()); */
       agent_query_dump_state ();
       agent_scd_dump_state ();
       break;

Modified: trunk/common/asshelp.c
===================================================================
--- trunk/common/asshelp.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/asshelp.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -27,6 +27,7 @@
 #include <locale.h>
 #endif
 
+#define JNLIB_NEED_LOG_LOGV
 #include "i18n.h"
 #include "util.h"
 #include "exechelp.h"
@@ -34,6 +35,36 @@
 #include "status.h" 
 #include "asshelp.h"
 
+
+static int
+my_libassuan_log_handler (assuan_context_t ctx, void *hook,
+                          unsigned int cat, const char *msg)
+{
+  unsigned int dbgval;
+
+  if (cat != ASSUAN_LOG_CONTROL)
+    return 0; /* We only want the control channel messages.  */
+  dbgval = hook? *(unsigned int*)hook : 0;
+  if (!(dbgval & 1024))
+    return 0; /* Assuan debugging is not enabled.  */
+
+  if (msg)
+    log_string (JNLIB_LOG_DEBUG, msg);
+
+  return 1;
+}
+
+
+/* Setup libassuan to use our own logging functions.  Should be used
+   early at startup.  */
+void
+setup_libassuan_logging (unsigned int *debug_var_address)
+{
+  assuan_set_log_cb (my_libassuan_log_handler, debug_var_address);
+}
+
+
+
 static gpg_error_t
 send_one_option (assuan_context_t ctx, gpg_err_source_t errsource,
                  const char *name, const char *value, int use_putenv)

Modified: trunk/common/asshelp.h
===================================================================
--- trunk/common/asshelp.h	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/asshelp.h	2010-03-11 12:34:11 UTC (rev 5290)
@@ -25,6 +25,9 @@
 
 #include "session-env.h"
 
+void setup_libassuan_logging (unsigned int *debug_var_address);
+
+
 gpg_error_t
 send_pinentry_environment (assuan_context_t ctx,
                            gpg_err_source_t errsource,

Modified: trunk/common/estream.c
===================================================================
--- trunk/common/estream.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/estream.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -2028,6 +2028,8 @@
 	buffer_new = buffer;
       else
 	{
+          if (!size)
+            size = BUFSIZ;
 	  buffer_new = mem_alloc (size);
 	  if (! buffer_new)
 	    {
@@ -3207,8 +3209,8 @@
 {
   int err;
   
-  if (((type == _IOFBF) || (type == _IOLBF) || (type == _IONBF))
-      && (! ((! size) && (type != _IONBF))))
+  if ((type == _IOFBF || type == _IOLBF || type == _IONBF)
+      && (!buf || size || type == _IONBF))
     {
       ESTREAM_LOCK (stream);
       err = es_set_buffering (stream, buf, type, size);

Modified: trunk/common/logging.c
===================================================================
--- trunk/common/logging.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/logging.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -415,7 +415,7 @@
 }
 
 static void
-do_logv (int level, const char *fmt, va_list arg_ptr)
+do_logv (int level, int ignore_arg_ptr, const char *fmt, va_list arg_ptr)
 {
   if (!logstream)
     {
@@ -478,7 +478,10 @@
 
   if (fmt)
     {
-      es_vfprintf_unlocked (logstream, fmt, arg_ptr);
+      if (ignore_arg_ptr)
+        es_fputs_unlocked (fmt, logstream);
+      else
+        es_vfprintf_unlocked (logstream, fmt, arg_ptr);
       if (*fmt && fmt[strlen(fmt)-1] != '\n')
         missing_lf = 1;
     }
@@ -503,76 +506,91 @@
 
 
 static void
-do_log( int level, const char *fmt, ... )
+do_log (int level, const char *fmt, ...)
 {
-    va_list arg_ptr ;
-
-    va_start( arg_ptr, fmt ) ;
-    do_logv( level, fmt, arg_ptr );
-    va_end(arg_ptr);
+  va_list arg_ptr ;
+  
+  va_start (arg_ptr, fmt) ;
+  do_logv (level, 0, fmt, arg_ptr);
+  va_end (arg_ptr);
 }
 
 
 void
 log_logv (int level, const char *fmt, va_list arg_ptr)
 {
-  do_logv (level, fmt, arg_ptr);
+  do_logv (level, 0, fmt, arg_ptr);
 }
 
+
 void
-log_info( const char *fmt, ... )
+log_string (int level, const char *string)
 {
-    va_list arg_ptr ;
+  /* We need to provide a dummy arg_ptr.  volatile is needed to
+     suppress compiler warnings.  */
+  volatile va_list dummy_arg_ptr;
 
-    va_start( arg_ptr, fmt ) ;
-    do_logv( JNLIB_LOG_INFO, fmt, arg_ptr );
-    va_end(arg_ptr);
+  do_logv (level, 1, string, dummy_arg_ptr);
 }
 
+
 void
-log_error( const char *fmt, ... )
+log_info (const char *fmt, ...)
 {
-    va_list arg_ptr ;
+  va_list arg_ptr ;
+  
+  va_start (arg_ptr, fmt);
+  do_logv (JNLIB_LOG_INFO, 0, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
 
-    va_start( arg_ptr, fmt ) ;
-    do_logv( JNLIB_LOG_ERROR, fmt, arg_ptr );
-    va_end(arg_ptr);
-    /* protect against counter overflow */
-    if( errorcount < 30000 )
-	errorcount++;
+
+void
+log_error (const char *fmt, ...)
+{
+  va_list arg_ptr ;
+  
+  va_start (arg_ptr, fmt);
+  do_logv (JNLIB_LOG_ERROR, 0, fmt, arg_ptr);
+  va_end (arg_ptr);
+  /* Protect against counter overflow.  */
+  if (errorcount < 30000)
+    errorcount++;
 }
 
 
 void
-log_fatal( const char *fmt, ... )
+log_fatal (const char *fmt, ...)
 {
-    va_list arg_ptr ;
-
-    va_start( arg_ptr, fmt ) ;
-    do_logv( JNLIB_LOG_FATAL, fmt, arg_ptr );
-    va_end(arg_ptr);
-    abort(); /* never called, but it makes the compiler happy */
+  va_list arg_ptr ;
+  
+  va_start (arg_ptr, fmt);
+  do_logv (JNLIB_LOG_FATAL, 0, fmt, arg_ptr);
+  va_end (arg_ptr);
+  abort (); /* Never called; just to make the compiler happy.  */
 }
 
+
 void
-log_bug( const char *fmt, ... )
+log_bug (const char *fmt, ...)
 {
-    va_list arg_ptr ;
+  va_list arg_ptr ;
 
-    va_start( arg_ptr, fmt ) ;
-    do_logv( JNLIB_LOG_BUG, fmt, arg_ptr );
-    va_end(arg_ptr);
-    abort(); /* never called, but it makes the compiler happy */
+  va_start (arg_ptr, fmt);
+  do_logv (JNLIB_LOG_BUG, 0, fmt, arg_ptr);
+  va_end (arg_ptr);
+  abort (); /* Never called; just to make the compiler happy.  */
 }
 
+
 void
-log_debug( const char *fmt, ... )
+log_debug (const char *fmt, ...)
 {
-    va_list arg_ptr ;
-
-    va_start( arg_ptr, fmt ) ;
-    do_logv( JNLIB_LOG_DEBUG, fmt, arg_ptr );
-    va_end(arg_ptr);
+  va_list arg_ptr ;
+  
+  va_start (arg_ptr, fmt);
+  do_logv (JNLIB_LOG_DEBUG, 0, fmt, arg_ptr);
+  va_end (arg_ptr);
 }
 
 
@@ -580,12 +598,13 @@
 log_printf (const char *fmt, ...)
 {
   va_list arg_ptr;
-
+  
   va_start (arg_ptr, fmt);
-  do_logv (fmt ? JNLIB_LOG_CONT : JNLIB_LOG_BEGIN, fmt, arg_ptr);
+  do_logv (fmt ? JNLIB_LOG_CONT : JNLIB_LOG_BEGIN, 0, fmt, arg_ptr);
   va_end (arg_ptr);
 }
 
+
 /* Print a hexdump of BUFFER.  With TEXT of NULL print just the raw
    dump, with TEXT just an empty string, print a trailing linefeed,
    otherwise print an entire debug line. */
@@ -610,17 +629,15 @@
 void
 bug_at( const char *file, int line, const char *func )
 {
-    do_log( JNLIB_LOG_BUG,
-	     ("... this is a bug (%s:%d:%s)\n"), file, line, func );
-    abort(); /* never called, but it makes the compiler happy */
+  do_log (JNLIB_LOG_BUG, ("... this is a bug (%s:%d:%s)\n"), file, line, func);
+  abort (); /* Never called; just to make the compiler happy.  */
 }
 #else
 void
 bug_at( const char *file, int line )
 {
-    do_log( JNLIB_LOG_BUG,
-	     _("you found a bug ... (%s:%d)\n"), file, line);
-    abort(); /* never called, but it makes the compiler happy */
+  do_log (JNLIB_LOG_BUG, _("you found a bug ... (%s:%d)\n"), file, line);
+  abort (); /* Never called; just to make the compiler happy.  */
 }
 #endif
 

Modified: trunk/common/logging.h
===================================================================
--- trunk/common/logging.h	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/logging.h	2010-03-11 12:34:11 UTC (rev 5290)
@@ -65,6 +65,7 @@
     JNLIB_LOG_DEBUG
 };
 void log_logv (int level, const char *fmt, va_list arg_ptr);
+void log_string (int level, const char *string);
 #endif /*JNLIB_NEED_LOG_LOGV*/
 
 

Modified: trunk/common/miscellaneous.c
===================================================================
--- trunk/common/miscellaneous.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/common/miscellaneous.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -26,7 +26,6 @@
 #include "iobuf.h"
 #include "i18n.h"
 
-
 /* Used by libgcrypt for logging.  */
 static void
 my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
@@ -97,7 +96,6 @@
 }
 
 
-
 /* Decide whether the filename is stdout or a real filename and return
  * an appropriate string.  */
 const char *

Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/g10/gpg.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -53,6 +53,7 @@
 #include "keyserver-internal.h"
 #include "exec.h"
 #include "gc-opt-flags.h"
+#include "asshelp.h"
 
 #if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
 #define MY_O_BINARY  O_BINARY
@@ -2070,8 +2071,8 @@
     malloc_hooks.realloc = gcry_realloc;
     malloc_hooks.free = gcry_free;
     assuan_set_malloc_hooks (&malloc_hooks);
-    assuan_set_assuan_log_prefix (log_get_prefix (NULL));
     assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
+    setup_libassuan_logging (&opt.debug);
  
     /* Try for a version specific config file first */
     default_configname = get_default_configname ();

Modified: trunk/g10/server.c
===================================================================
--- trunk/g10/server.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/g10/server.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -735,9 +735,6 @@
   ctrl->server_local->assuan_ctx = ctx;
   ctrl->server_local->message_fd = GNUPG_INVALID_FD;
 
-  if (DBG_ASSUAN)
-    assuan_set_log_stream (ctx, log_get_stream ());
-
   for (;;)
     {
       rc = assuan_accept (ctx);

Modified: trunk/g13/g13.c
===================================================================
--- trunk/g13/g13.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/g13/g13.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -35,6 +35,7 @@
 #include "i18n.h"
 #include "sysutils.h"
 #include "gc-opt-flags.h"
+#include "asshelp.h"
 #include "keyblob.h"
 #include "server.h"
 #include "runner.h"
@@ -432,11 +433,10 @@
   }
   
   /* Prepare libassuan.  */
-  assuan_set_assuan_log_prefix (log_get_prefix (NULL));
   assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
   assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
+  setup_libassuan_logging (&opt.debug);
 
-
   /* Setup a default control structure for command line mode.  */
   memset (&ctrl, 0, sizeof ctrl);
   g13_init_default_ctrl (&ctrl);
@@ -799,7 +799,9 @@
       
     case SIGUSR1:
       log_info ("SIGUSR1 received - printing internal information:\n");
-      pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
+      /* Fixme: We need to see how to integrate pth dumping into our
+         logging system.  */
+      /* pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ()); */
       mountinfo_dump_all ();
       break;
 

Modified: trunk/g13/server.c
===================================================================
--- trunk/g13/server.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/g13/server.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -642,9 +642,6 @@
     }
   ctrl->server_local->assuan_ctx = ctx;
 
-  if (DBG_ASSUAN)
-    assuan_set_log_stream (ctx, log_get_stream ());
-
   while ( !(err = assuan_accept (ctx)) )
     {
       err = assuan_process (ctx);

Modified: trunk/scd/command.c
===================================================================
--- trunk/scd/command.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/scd/command.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1947,9 +1947,6 @@
   ctrl->server_local->ctrl_backlink = ctrl;
   ctrl->server_local->assuan_ctx = ctx;
 
-  if (DBG_ASSUAN)
-    assuan_set_log_stream (ctx, log_get_stream ());
-
   /* We open the reader right at startup so that the ticker is able to
      update the status file. */
   if (ctrl->reader_slot == -1)

Modified: trunk/scd/scdaemon.c
===================================================================
--- trunk/scd/scdaemon.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/scd/scdaemon.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -52,6 +52,7 @@
 #include "ccid-driver.h"
 #include "mkdtemp.h"
 #include "gc-opt-flags.h"
+#include "asshelp.h"
 
 enum cmd_and_opt_values 
 { aNull = 0,
@@ -432,10 +433,10 @@
   malloc_hooks.realloc = gcry_realloc;
   malloc_hooks.free = gcry_free;
   assuan_set_malloc_hooks (&malloc_hooks);
-  assuan_set_assuan_log_prefix (log_get_prefix (NULL));
   assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
   assuan_set_system_hooks (ASSUAN_SYSTEM_PTH);
   assuan_sock_init ();
+  setup_libassuan_logging (&opt.debug);
 
   setup_libgcrypt_logging ();
   gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
@@ -951,7 +952,9 @@
       
     case SIGUSR1:
       log_info ("SIGUSR1 received - printing internal information:\n");
-      pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
+      /* Fixme: We need to see how to integrate pth dumping into our
+         logging system.  */
+      /* pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ()); */
       app_dump_state ();
       break;
 

Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/sm/gpgsm.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -37,8 +37,8 @@
 #include "keydb.h"
 #include "sysutils.h"
 #include "gc-opt-flags.h"
+#include "asshelp.h"
 
-
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
@@ -982,8 +982,8 @@
   malloc_hooks.realloc = gcry_realloc;
   malloc_hooks.free = gcry_free;
   assuan_set_malloc_hooks (&malloc_hooks);
-  assuan_set_assuan_log_prefix (log_get_prefix (NULL));
   assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
+  setup_libassuan_logging (&opt.debug);
 
   keybox_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
 

Modified: trunk/sm/server.c
===================================================================
--- trunk/sm/server.c	2010-03-10 17:22:23 UTC (rev 5289)
+++ trunk/sm/server.c	2010-03-11 12:34:11 UTC (rev 5290)
@@ -1311,9 +1311,6 @@
   ctrl.server_local->list_external = 0;
   ctrl.server_local->default_recplist = default_recplist;
 
-  if (DBG_ASSUAN)
-    assuan_set_log_stream (ctx, log_get_stream ());
-
   for (;;)
     {
       rc = assuan_accept (ctx);




More information about the Gnupg-commits mailing list