From 482f47ffe26bf5d4d3ca0f0de81380b3cb061be3 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 8 Apr 2005 22:31:04 +0000 Subject: include support for 2.0.xx --- include/mod_gnutls.h.in | 13 +++++++++++++ src/mod_gnutls.c | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/include/mod_gnutls.h.in b/include/mod_gnutls.h.in index 234e23c..d9b989e 100644 --- a/include/mod_gnutls.h.in +++ b/include/mod_gnutls.h.in @@ -25,6 +25,7 @@ #include "apr_buckets.h" #include "apr_strings.h" #include "apr_tables.h" +#include "ap_release.h" #ifndef __mod_gnutls_h_inc #define __mod_gnutls_h_inc @@ -46,6 +47,18 @@ module AP_MODULE_DECLARE_DATA gnutls_module; #define MOD_GNUTLS_DEBUG @OOO_MAINTAIN@ +/* Recent Versions of 2.1 renamed several hooks. This allows us to + compile on 2.0.xx */ +#if AP_SERVER_MINORVERSION_NUMBER >= 1 +#if AP_SERVER_PATCHLEVEL_NUMBER >= 3 +#define USING_2_1_RECENT 1 +#endif +#endif + +#ifndef USING_2_1_RECENT +#define USING_2_1_RECENT 0 +#endif + typedef enum { mod_gnutls_cache_none, diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c index ad07d5f..71076ef 100644 --- a/src/mod_gnutls.c +++ b/src/mod_gnutls.c @@ -526,8 +526,13 @@ static void gnutls_hooks(apr_pool_t * p) APR_HOOK_MIDDLE); ap_hook_child_init(mod_gnutls_hook_child_init, NULL, NULL, APR_HOOK_MIDDLE); +#if USING_2_1_RECENT ap_hook_http_scheme(mod_gnutls_hook_http_scheme, NULL, NULL, APR_HOOK_MIDDLE); +#else + ap_hook_http_method(mod_gnutls_hook_http_scheme, NULL, NULL, + APR_HOOK_MIDDLE); +#endif ap_hook_default_port(mod_gnutls_hook_default_port, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_pre_config(mod_gnutls_hook_pre_config, NULL, NULL, -- cgit