1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

ap_die: get rid of bad side effects from the recursive error handling code

that mess with the status and which request_rec the rest of the function uses.

Submitted by:  Justin Erenkrantz, Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95834 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Greg Ames
2002-06-21 13:58:39 +00:00
parent 8bdeaea8ac
commit 38de4bc46f

View File

@@ -101,6 +101,7 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
int error_index = ap_index_of_response(type); int error_index = ap_index_of_response(type);
char *custom_response = ap_response_code_string(r, error_index); char *custom_response = ap_response_code_string(r, error_index);
int recursive_error = 0; int recursive_error = 0;
request_rec *r_1st_err = r;
if (type == AP_FILTER_ERROR) { if (type == AP_FILTER_ERROR) {
return; return;
@@ -120,10 +121,9 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
if (r->status != HTTP_OK) { if (r->status != HTTP_OK) {
recursive_error = type; recursive_error = type;
while (r->prev && (r->prev->status != HTTP_OK)) while (r_1st_err->prev && (r_1st_err->prev->status != HTTP_OK))
r = r->prev; /* Get back to original error */ r_1st_err = r_1st_err->prev; /* Get back to original error */
type = r->status;
custom_response = NULL; /* Do NOT retry the custom thing! */ custom_response = NULL; /* Do NOT retry the custom thing! */
} }
@@ -198,7 +198,7 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
custom_response); custom_response);
} }
} }
ap_send_error_response(r, recursive_error); ap_send_error_response(r_1st_err, recursive_error);
} }
static void check_pipeline_flush(request_rec *r) static void check_pipeline_flush(request_rec *r)