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 | |
parent | a8c131064d77af317a04210c8b3cdf9c80d8db90 (diff) |
wrap the debug log in maintainer mode.
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | include/mod_gnutls.h.in | 2 | ||||
-rw-r--r-- | src/mod_gnutls.c | 6 |
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 | |||
4 | AC_PREREQ(2.53) | 4 | AC_PREREQ(2.53) |
5 | AC_CONFIG_SRCDIR([src/mod_gnutls.c]) | 5 | AC_CONFIG_SRCDIR([src/mod_gnutls.c]) |
6 | AC_CONFIG_AUX_DIR(config) | 6 | AC_CONFIG_AUX_DIR(config) |
7 | OOO_MAINTAIN_MODE | ||
7 | AM_MAINTAINER_MODE | 8 | AM_MAINTAINER_MODE |
8 | AC_CANONICAL_TARGET | 9 | AC_CANONICAL_TARGET |
9 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) | 10 | 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; | |||
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 | |||
47 | typedef enum | 49 | typedef 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 @@ | |||
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 | } |