From 5a6446d26767fb0f0f8164a62fe1100d0a304d88 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 8 Apr 2005 21:15:51 +0000 Subject: wrap the debug log in maintainer mode. --- src/mod_gnutls.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c index b803ce7..ad07d5f 100644 --- a/src/mod_gnutls.c +++ b/src/mod_gnutls.c @@ -21,7 +21,9 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL; #endif +#if MOD_GNUTLS_DEBUG static apr_file_t* debug_log_fp; +#endif static apr_status_t mod_gnutls_cleanup_pre_config(void *data) { @@ -29,10 +31,12 @@ static apr_status_t mod_gnutls_cleanup_pre_config(void *data) return APR_SUCCESS; } +#if MOD_GNUTLS_DEBUG static void gnutls_debug_log_all( int level, const char* str) { apr_file_printf(debug_log_fp, "<%d> %s\n", level, str); } +#endif static int mod_gnutls_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp) @@ -48,11 +52,13 @@ static int mod_gnutls_hook_pre_config(apr_pool_t * pconf, apr_pool_cleanup_register(pconf, NULL, mod_gnutls_cleanup_pre_config, apr_pool_cleanup_null); +#if MOD_GNUTLS_DEBUG apr_file_open(&debug_log_fp, "/tmp/gnutls_debug", APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pconf); gnutls_global_set_log_level(9); gnutls_global_set_log_function(gnutls_debug_log_all); +#endif return OK; } -- cgit