From: André Malo Date: Sat, 10 Apr 2004 18:40:53 +0000 (+0000) Subject: "ErrorDocument default" changes broke inheritance. consider: X-Git-Tag: pre_ajp_proxy~391 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b00e035fc463ccd02e11940ea7579cd42fb5fbff;p=apache "ErrorDocument default" changes broke inheritance. consider: ErrorDocument 404 blah ErrorDocument 500 boo # 404 is now fallen back to default This patch solves the problem. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103333 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core.c b/server/core.c index 915f752d6c..ff1b1afaef 100644 --- a/server/core.c +++ b/server/core.c @@ -82,6 +82,9 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle; +/* magic pointer for ErrorDocument xxx "default" */ +static char errordocument_default; + static void *create_core_dir_config(apr_pool_t *a, char *dir) { core_dir_config *conf; @@ -271,7 +274,9 @@ static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv) sizeof(*conf->response_code_strings) * RESPONSE_CODES); for (i = 0; i < RESPONSE_CODES; ++i) { - conf->response_code_strings[i] = new->response_code_strings[i]; + if (new->response_code_strings[i] != NULL) { + conf->response_code_strings[i] = new->response_code_strings[i]; + } } } /* Otherwise we simply use the base->response_code_strings array @@ -695,6 +700,10 @@ char *ap_response_code_string(request_rec *r, int error_index) return NULL; } + if (dirconf->response_code_strings[error_index] == &errordocument_default) { + return NULL; + } + return dirconf->response_code_strings[error_index]; } @@ -1180,7 +1189,7 @@ static const char *set_error_document(cmd_parms *cmd, void *conf_, /* special case: ErrorDocument 404 default restores the * canned server error response */ - conf->response_code_strings[index_number] = NULL; + conf->response_code_strings[index_number] = &errordocument_default; } else { /* hack. Prefix a " if it is a msg; as that is what