aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--include/mod_gnutls.h.in2
-rw-r--r--src/mod_gnutls.c6
3 files changed, 9 insertions, 0 deletions
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
4AC_PREREQ(2.53) 4AC_PREREQ(2.53)
5AC_CONFIG_SRCDIR([src/mod_gnutls.c]) 5AC_CONFIG_SRCDIR([src/mod_gnutls.c])
6AC_CONFIG_AUX_DIR(config) 6AC_CONFIG_AUX_DIR(config)
7OOO_MAINTAIN_MODE
7AM_MAINTAINER_MODE 8AM_MAINTAINER_MODE
8AC_CANONICAL_TARGET 9AC_CANONICAL_TARGET
9AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) 10AM_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;
44 44
45#define MOD_GNUTLS_VERSION "@MOD_GNUTLS_VERSION@" 45#define MOD_GNUTLS_VERSION "@MOD_GNUTLS_VERSION@"
46 46
47#define MOD_GNUTLS_DEBUG @OOO_MAINTAIN@
48
47typedef enum 49typedef enum
48{ 50{
49 mod_gnutls_cache_none, 51 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 @@
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}