From: Simo Sorce Date: Sat, 12 Apr 2014 22:14:37 +0000 (-0400) Subject: Register optional functions X-Git-Tag: v1.0.0~12 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mod_auth_gssapi.git;a=commitdiff_plain;h=3e02602bd7ed79fc0ec54256322603f30ee1834f Register optional functions --- 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); }