mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
dirmngr: Setup a log handler for ntbtls.
* dirmngr/dirmngr.c (my_ntbtls_log_handler) [HTTP_USE_NTBTLS]: New. (main) [HTTP_USE_NTBTLS]: Register log handler. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
3e9512e557
commit
a022baa4a4
@ -715,6 +715,23 @@ pid_suffix_callback (unsigned long *r_suffix)
|
||||
}
|
||||
#endif /*!HAVE_W32_SYSTEM*/
|
||||
|
||||
#if HTTP_USE_NTBTLS
|
||||
static void
|
||||
my_ntbtls_log_handler (void *opaque, int level, const char *fmt, va_list argv)
|
||||
{
|
||||
(void)opaque;
|
||||
|
||||
if (level == -1)
|
||||
log_logv_with_prefix (GPGRT_LOG_INFO, "ntbtls: ", fmt, argv);
|
||||
else
|
||||
{
|
||||
char prefix[10+20];
|
||||
snprintf (prefix, sizeof prefix, "ntbtls(%d): ", level);
|
||||
log_logv_with_prefix (GPGRT_LOG_DEBUG, prefix, fmt, argv);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
thread_init (void)
|
||||
@ -801,6 +818,10 @@ main (int argc, char **argv)
|
||||
|
||||
setup_libgcrypt_logging ();
|
||||
|
||||
#if HTTP_USE_NTBTLS
|
||||
ntbtls_set_log_handler (my_ntbtls_log_handler, NULL);
|
||||
#endif
|
||||
|
||||
/* Setup defaults. */
|
||||
shell = getenv ("SHELL");
|
||||
if (shell && strlen (shell) >= 3 && !strcmp (shell+strlen (shell)-3, "csh") )
|
||||
|
Loading…
x
Reference in New Issue
Block a user