aboutsummaryrefslogtreecommitdiffstats
path: root/src/mod_gnutls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_gnutls.c')
-rw-r--r--src/mod_gnutls.c6
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 @@
21GCRY_THREAD_OPTION_PTHREAD_IMPL; 21GCRY_THREAD_OPTION_PTHREAD_IMPL;
22#endif 22#endif
23 23
24#if MOD_GNUTLS_DEBUG
24static apr_file_t* debug_log_fp; 25static apr_file_t* debug_log_fp;
26#endif
25 27
26static apr_status_t mod_gnutls_cleanup_pre_config(void *data) 28static 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
32static void gnutls_debug_log_all( int level, const char* str) 35static 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
37static int mod_gnutls_hook_pre_config(apr_pool_t * pconf, 41static 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}