diff options
| author | 2008-10-01 16:01:42 +0000 | |
|---|---|---|
| committer | 2008-10-01 16:01:42 +0000 | |
| commit | a208cd3cc2ae4dfffe47ddacd1d0ee517d6b0ee5 (patch) | |
| tree | 5ec2340c7e74f9f8b6ad1a68571d9f936949477f /src | |
| parent | 26b08fd87c60d193388b6657596c7c9801c9abe4 (diff) | |
better logging
Diffstat (limited to 'src')
| -rw-r--r-- | src/gnutls_hooks.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c index 54b0a83..57d3aaf 100644 --- a/src/gnutls_hooks.c +++ b/src/gnutls_hooks.c | |||
| @@ -54,6 +54,9 @@ static void gnutls_debug_log_all(int level, const char *str) | |||
| 54 | { | 54 | { |
| 55 | apr_file_printf(debug_log_fp, "<%d> %s\n", level, str); | 55 | apr_file_printf(debug_log_fp, "<%d> %s\n", level, str); |
| 56 | } | 56 | } |
| 57 | #define _gnutls_log apr_file_printf | ||
| 58 | #else | ||
| 59 | # define _gnutls_log(...) | ||
| 57 | #endif | 60 | #endif |
| 58 | 61 | ||
| 59 | int | 62 | int |
| @@ -67,11 +70,11 @@ int ret; | |||
| 67 | APR_APPEND | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, | 70 | APR_APPEND | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, |
| 68 | pconf); | 71 | pconf); |
| 69 | 72 | ||
| 70 | apr_file_printf(debug_log_fp, "%s: %d\n", __func__, __LINE__); | 73 | _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__); |
| 71 | 74 | ||
| 72 | gnutls_global_set_log_level(9); | 75 | gnutls_global_set_log_level(9); |
| 73 | gnutls_global_set_log_function(gnutls_debug_log_all); | 76 | gnutls_global_set_log_function(gnutls_debug_log_all); |
| 74 | apr_file_printf(debug_log_fp, "gnutls: %s\n", gnutls_check_version(NULL)); | 77 | _gnutls_log(debug_log_fp, "gnutls: %s\n", gnutls_check_version(NULL)); |
| 75 | #endif | 78 | #endif |
| 76 | 79 | ||
| 77 | #if APR_HAS_THREADS | 80 | #if APR_HAS_THREADS |
| @@ -84,14 +87,14 @@ int ret; | |||
| 84 | #endif | 87 | #endif |
| 85 | 88 | ||
| 86 | if (gnutls_check_version(LIBGNUTLS_VERSION)==NULL) { | 89 | if (gnutls_check_version(LIBGNUTLS_VERSION)==NULL) { |
| 87 | apr_file_printf(debug_log_fp, "gnutls_check_version() failed. Required: gnutls-%s Found: gnutls-%s\n", | 90 | _gnutls_log(debug_log_fp, "gnutls_check_version() failed. Required: gnutls-%s Found: gnutls-%s\n", |
| 88 | LIBGNUTLS_VERSION, gnutls_check_version(NULL)); | 91 | LIBGNUTLS_VERSION, gnutls_check_version(NULL)); |
| 89 | return -3; | 92 | return -3; |
| 90 | } | 93 | } |
| 91 | 94 | ||
| 92 | ret = gnutls_global_init(); | 95 | ret = gnutls_global_init(); |
| 93 | if (ret < 0) { | 96 | if (ret < 0) { |
| 94 | apr_file_printf(debug_log_fp, "gnutls_global_init: %s\n", gnutls_strerror(ret)); | 97 | _gnutls_log(debug_log_fp, "gnutls_global_init: %s\n", gnutls_strerror(ret)); |
| 95 | return -3; | 98 | return -3; |
| 96 | } | 99 | } |
| 97 | 100 | ||
| @@ -109,7 +112,7 @@ static int mgs_select_virtual_server_cb(gnutls_session_t session) | |||
| 109 | int ret; | 112 | int ret; |
| 110 | int cprio[2]; | 113 | int cprio[2]; |
| 111 | 114 | ||
| 112 | apr_file_printf(debug_log_fp, "%s: %d\n", __func__, __LINE__); | 115 | _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__); |
| 113 | 116 | ||
| 114 | ctxt = gnutls_transport_get_ptr(session); | 117 | ctxt = gnutls_transport_get_ptr(session); |
| 115 | 118 | ||
| @@ -167,7 +170,7 @@ static int cert_retrieve_fn(gnutls_session_t session, gnutls_retr_st * ret) | |||
| 2004-09-27 | |||
| * | commit before i move everything around | 2004-09-27 | |
| * | updated | 2004-09-27 | |
