summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-03-11 13:34:11 +0100
committerWerner Koch <wk@gnupg.org>2010-03-11 13:34:11 +0100
commit37870234a195fb76f36284ac4bdb5dc172078724 (patch)
treef65b4c42925edb20ff4149a977d12a4d31d432a0 /agent
parentChange logging to use estream. The makes logging to a socket also (diff)
downloadgnupg2-37870234a195fb76f36284ac4bdb5dc172078724.tar.xz
gnupg2-37870234a195fb76f36284ac4bdb5dc172078724.zip
Use a custom log handler for libassuan.
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog9
-rw-r--r--agent/call-scd.c2
-rw-r--r--agent/gpg-agent.c13
3 files changed, 15 insertions, 9 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index e4fbe073b..d424f2b58 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-11 Werner Koch <wk@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@g10code.com>
* Makefile.am (common_libs): Remove libjnlib.a.
diff --git a/agent/call-scd.c b/agent/call-scd.c
index f3303c11d..d37183ba6 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -354,8 +354,6 @@ start_scd (ctrl_t ctrl)
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. */
{
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 73f84ed82..4ff5774dc 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -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 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
|| 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 @@ main (int argc, char **argv )
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 @@ main (int argc, char **argv )
|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 @@ handle_signal (int signo)
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;