diff options
Diffstat (limited to 'server/protocol.c')
-rw-r--r-- | server/protocol.c | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/server/protocol.c b/server/protocol.c index 4eac201e04..7add84a77a 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -2636,92 +2636,6 @@ AP_DECLARE(int) ap_is_allowed_protocol(conn_rec *c, request_rec *r, return !strcmp(AP_PROTOCOL_HTTP1, protocol); } -APR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *)); -static APR_OPTIONAL_FN_TYPE(ssl_is_https) *module_ssl_is_https; - -static int ssl_is_https(conn_rec *c) -{ - /* Someone retrieved the optional function., not knowning about the - * new API. We redirect them to what they should have inoked. */ - return ap_ssl_conn_is_ssl(c); -} - -AP_DECLARE(int) ap_ssl_conn_is_ssl(conn_rec *c) -{ - int r = (ap_run_ssl_conn_is_ssl(c) == OK); - if (r == 0 && module_ssl_is_https) { - r = module_ssl_is_https(c); - } - return r; -} - -APR_DECLARE_OPTIONAL_FN(const char *, ssl_var_lookup, - (apr_pool_t *p, server_rec *s, - conn_rec *c, request_rec *r, - const char *name)) - AP_FN_ATTR_NONNULL((1, 2, 5)) AP_FN_ATTR_WARN_UNUSED_RESULT; -static APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *module_ssl_var_lookup; - -static const char *ssl_var_lookup(apr_pool_t *p, server_rec *s, - conn_rec *c, request_rec *r, - const char *name) -{ - /* Someone retrieved the optional function., not knowning about the - * new API. We redirect them to what they should have inoked. */ - return ap_ssl_var_lookup(p, s, c, r, name); -} - -AP_DECLARE(const char *) ap_ssl_var_lookup(apr_pool_t *p, server_rec *s, - conn_rec *c, request_rec *r, - const char *name) -{ - const char *val = ap_run_ssl_var_lookup(p, s, c, r, name); - if (val == NULL && module_ssl_is_https) { - val = module_ssl_var_lookup(p, s, c, r, name); - } - return val; -} - -AP_DECLARE(void) ap_setup_ssl_optional_fns(apr_pool_t *pool) -{ - /* Run as core's very early 'post config' hook, check for any already - * installed optional functions related to SSL and save them. Install - * our own instances that invoke the new hooks. */ - APR_OPTIONAL_FN_TYPE(ssl_is_https) *fn_is_https; - APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *fn_ssl_var_lookup; - - fn_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https); - module_ssl_is_https = (fn_is_https - && fn_is_https != ssl_is_https)? fn_is_https : NULL; - APR_REGISTER_OPTIONAL_FN(ssl_is_https); - - fn_ssl_var_lookup = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup); - module_ssl_var_lookup = (fn_ssl_var_lookup - && fn_ssl_var_lookup != ssl_var_lookup)? fn_ssl_var_lookup : NULL; - APR_REGISTER_OPTIONAL_FN(ssl_var_lookup); -} - -AP_DECLARE(apr_status_t) ap_ssl_add_cert_files(server_rec *s, apr_pool_t *p, - apr_array_header_t *cert_files, - apr_array_header_t *key_files) -{ - int rv = ap_run_ssl_add_cert_files(s, p, cert_files, key_files); - return (rv == OK || rv == DECLINED)? APR_SUCCESS : APR_EGENERAL; -} - -AP_DECLARE(apr_status_t) ap_ssl_add_fallback_cert_files(server_rec *s, apr_pool_t *p, - apr_array_header_t *cert_files, - apr_array_header_t *key_files) -{ - int rv = ap_run_ssl_add_fallback_cert_files(s, p, cert_files, key_files); - return (rv == OK || rv == DECLINED)? APR_SUCCESS : APR_EGENERAL; -} - -AP_DECLARE(int) ap_ssl_answer_challenge(conn_rec *c, const char *server_name, - const char **pcert_pem, const char **pkey_pem) -{ - return (ap_run_ssl_answer_challenge(c, server_name, pcert_pem, pkey_pem) == OK); -} AP_IMPLEMENT_HOOK_VOID(pre_read_request, (request_rec *r, conn_rec *c), @@ -2748,20 +2662,3 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(int,protocol_switch, (c, r, s, protocol), DECLINED) AP_IMPLEMENT_HOOK_RUN_FIRST(const char *,protocol_get, (const conn_rec *c), (c), NULL) -AP_IMPLEMENT_HOOK_RUN_FIRST(int, ssl_conn_is_ssl, - (conn_rec *c), (c), DECLINED) -AP_IMPLEMENT_HOOK_RUN_FIRST(const char *,ssl_var_lookup, - (apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *name), - (p, s, c, r, name), NULL) -AP_IMPLEMENT_HOOK_RUN_ALL(int, ssl_add_cert_files, - (server_rec *s, apr_pool_t *p, - apr_array_header_t *cert_files, apr_array_header_t *key_files), - (s, p, cert_files, key_files), OK, DECLINED) -AP_IMPLEMENT_HOOK_RUN_ALL(int, ssl_add_fallback_cert_files, - (server_rec *s, apr_pool_t *p, - apr_array_header_t *cert_files, apr_array_header_t *key_files), - (s, p, cert_files, key_files), OK, DECLINED) -AP_IMPLEMENT_HOOK_RUN_FIRST(int, ssl_answer_challenge, - (conn_rec *c, const char *server_name, const char **pcert_pem, const char **pkey_pem), - (c, server_name, pcert_pem, pkey_pem), DECLINED) - |