mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-11 22:01:08 +02: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*/
|
#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
|
static void
|
||||||
thread_init (void)
|
thread_init (void)
|
||||||
@ -801,6 +818,10 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
setup_libgcrypt_logging ();
|
setup_libgcrypt_logging ();
|
||||||
|
|
||||||
|
#if HTTP_USE_NTBTLS
|
||||||
|
ntbtls_set_log_handler (my_ntbtls_log_handler, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Setup defaults. */
|
/* Setup defaults. */
|
||||||
shell = getenv ("SHELL");
|
shell = getenv ("SHELL");
|
||||||
if (shell && strlen (shell) >= 3 && !strcmp (shell+strlen (shell)-3, "csh") )
|
if (shell && strlen (shell) >= 3 && !strcmp (shell+strlen (shell)-3, "csh") )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user