diff options
author | Paul Querna | 2005-04-08 21:15:51 +0000 |
---|---|---|
committer | Paul Querna | 2005-04-08 21:15:51 +0000 |
commit | 5a6446d26767fb0f0f8164a62fe1100d0a304d88 (patch) | |
tree | 881cdd83a7108cfba5934dcdade6b3419cd706fd /src | |
parent | a8c131064d77af317a04210c8b3cdf9c80d8db90 (diff) |
wrap the debug log in maintainer mode.
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_gnutls.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 @@ | |||
21 | GCRY_THREAD_OPTION_PTHREAD_IMPL; | 21 | GCRY_THREAD_OPTION_PTHREAD_IMPL; |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #if MOD_GNUTLS_DEBUG | ||
24 | static apr_file_t* debug_log_fp; | 25 | static apr_file_t* debug_log_fp; |
26 | #endif | ||
25 | 27 | ||
26 | static apr_status_t mod_gnutls_cleanup_pre_config(void *data) | 28 | static apr_status_t mod_gnutls_cleanup_pre_config(void *data) |
27 | { | 29 | { |
@@ -29,10 +31,12 @@ static apr_status_t mod_gnutls_cleanup_pre_config(void *data) | |||
29 | return APR_SUCCESS; | 31 | return APR_SUCCESS; |
30 | } | 32 | } |
31 | 33 | ||
34 | #if MOD_GNUTLS_DEBUG | ||
32 | static void gnutls_debug_log_all( int level, const char* str) | 35 | static void gnutls_debug_log_all( int level, const char* str) |
33 | { | 36 | { |
34 | apr_file_printf(debug_log_fp, "<%d> %s\n", level, str); | 37 | apr_file_printf(debug_log_fp, "<%d> %s\n", level, str); |
35 | } | 38 | } |
39 | #endif | ||
36 | 40 | ||
37 | static int mod_gnutls_hook_pre_config(apr_pool_t * pconf, | 41 | static int mod_gnutls_hook_pre_config(apr_pool_t * pconf, |
38 | apr_pool_t * plog, apr_pool_t * ptemp) | 42 | apr_pool_t * plog, apr_pool_t * ptemp) |
@@ -48,11 +52,13 @@ static int mod_gnutls_hook_pre_config(apr_pool_t * pconf, | |||
48 | apr_pool_cleanup_register(pconf, NULL, mod_gnutls_cleanup_pre_config, | 52 | apr_pool_cleanup_register(pconf, NULL, mod_gnutls_cleanup_pre_config, |
49 | apr_pool_cleanup_null); | 53 | apr_pool_cleanup_null); |
50 | 54 | ||
55 | #if MOD_GNUTLS_DEBUG | ||
51 | apr_file_open(&debug_log_fp, "/tmp/gnutls_debug", | 56 | apr_file_open(&debug_log_fp, "/tmp/gnutls_debug", |
52 | APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pconf); | 57 | APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pconf); |
53 | 58 | ||
54 | gnutls_global_set_log_level(9); | 59 | gnutls_global_set_log_level(9); |
55 | gnutls_global_set_log_function(gnutls_debug_log_all); | 60 | gnutls_global_set_log_function(gnutls_debug_log_all); |
61 | #endif | ||
56 | 62 | ||
57 | return OK; | 63 | return OK; |
58 | } | 64 | } |