diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-09-20 14:51:15 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-09-20 14:51:15 +0000 |
commit | 639411a16c6553b6a905b608536b5418e95126d9 (patch) | |
tree | 02b9abe177721e5901bde8d87a11f02d7cd01571 | |
parent | aea3b66f17d9bcb81c1e9af3490aa354016f1fd5 (diff) | |
download | gnutls-639411a16c6553b6a905b608536b5418e95126d9.tar.gz |
enabled error messages of libgcrypt in debug mode
-rw-r--r-- | lib/gnutls_global.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c index f584bfe0dd..f45dccd5f8 100644 --- a/lib/gnutls_global.c +++ b/lib/gnutls_global.c @@ -123,6 +123,14 @@ void gnutls_global_set_mem_functions( return; } +#ifdef DEBUG +static void _gnutls_gcry_log_handler( void* dummy, int level, const char* fmt, + va_list list) +{ + _gnutls_log( fmt, list); +} +#endif + static int _gnutls_init = 0; /** @@ -157,7 +165,12 @@ int gnutls_global_init( void) /* gcry_control (GCRYCTL_DISABLE_INTERNAL_LOCKING, NULL, 0); */ gcry_control (GCRYCTL_INITIALIZATION_FINISHED, NULL,0); + +#ifdef DEBUG + gcry_set_log_handler( _gnutls_gcry_log_handler, NULL); +#else gcry_control (GCRYCTL_SET_VERBOSITY, (int)0); +#endif } /* set default recv/send functions |