From 3e02602bd7ed79fc0ec54256322603f30ee1834f Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 12 Apr 2014 18:14:37 -0400 Subject: [PATCH] Register optional functions --- src/mod_auth_gssapi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mod_auth_gssapi.c b/src/mod_auth_gssapi.c index 9e3eca3..0cb548a 100644 --- a/src/mod_auth_gssapi.c +++ b/src/mod_auth_gssapi.c @@ -87,6 +87,18 @@ static char *mag_error(request_rec *req, const char *msg, return apr_psprintf(req->pool, "%s: [%s (%s)]", msg, msg_maj, msg_min); } +static APR_OPTIONAL_FN_TYPE(ssl_is_https) *mag_is_https = NULL; + +static int mag_post_config(apr_pool_t *cfg, apr_pool_t *log, + apr_pool_t *temp, server_rec *s) +{ + /* FIXME: create mutex to deal with connections and contexts ? */ + mag_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https); + + return OK; +} + + struct mag_conn { gss_ctx_id_t ctx; bool established; @@ -105,8 +117,6 @@ static int mag_pre_connection(conn_rec *c, void *csd) return OK; } -static APR_OPTIONAL_FN_TYPE(ssl_is_https) *mag_is_https = NULL; - static bool mag_conn_is_https(conn_rec *c) { if (mag_is_https) { @@ -370,6 +380,7 @@ static void mag_register_hooks(apr_pool_t *p) { ap_hook_check_user_id(mag_auth, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_post_config(mag_post_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_pre_connection(mag_pre_connection, NULL, NULL, APR_HOOK_MIDDLE); } -- 2.1.4