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. --- configure.ac | 1 + include/mod_gnutls.h.in | 2 ++ src/mod_gnutls.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 862aaca..a16da41 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,7 @@ MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION AC_PREREQ(2.53) AC_CONFIG_SRCDIR([src/mod_gnutls.c]) AC_CONFIG_AUX_DIR(config) +OOO_MAINTAIN_MODE AM_MAINTAINER_MODE AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) diff --git a/include/mod_gnutls.h.in b/include/mod_gnutls.h.in index 58fc928..234e23c 100644 --- a/include/mod_gnutls.h.in +++ b/include/mod_gnutls.h.in @@ -44,6 +44,8 @@ module AP_MODULE_DECLARE_DATA gnutls_module; #define MOD_GNUTLS_VERSION "@MOD_GNUTLS_VERSION@" +#define MOD_GNUTLS_DEBUG @OOO_MAINTAIN@ + typedef enum { mod_gnutls_cache_none, 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