Fixed the wrong status being displayed in the error page. See #3.

This commit is contained in:
brectanus 2007-09-26 19:47:06 +00:00
parent 72f8149338
commit 7c393c4874

View File

@ -258,6 +258,9 @@ static apr_status_t send_error_bucket(ap_filter_t *f, int status) {
apr_bucket_brigade *brigade = NULL; apr_bucket_brigade *brigade = NULL;
apr_bucket *bucket = NULL; apr_bucket *bucket = NULL;
/* Set the status line explicitly */
f->r->status_line = ap_get_status_line(status);
brigade = apr_brigade_create(f->r->pool, f->r->connection->bucket_alloc); brigade = apr_brigade_create(f->r->pool, f->r->connection->bucket_alloc);
if (brigade == NULL) return APR_EGENERAL; if (brigade == NULL) return APR_EGENERAL;
@ -273,17 +276,13 @@ static apr_status_t send_error_bucket(ap_filter_t *f, int status) {
ap_pass_brigade(f->next, brigade); ap_pass_brigade(f->next, brigade);
// TODO: Should return an error if this function failed, but currently /* NOTE:
// coded to pass this on as the filter return value. The calling code * It may not matter what we return from the filter as it may be too
// needs changed to return an error after checking this return value * late to even generate an error (already sent to client). Nick Kew
// and possibly generating a log entry. * recommends to return APR_EGENERAL in hopes that the handler in control
// * will notice and do The Right Thing. So, that is what we do now.
// Also note that ap_pass_brigade will return APR_SUCCESS, so we should */
// not pass this on to be returned by the filter on error. Although
// it may not matter what we return from the filter as it may be too
// late to even generate an error (already sent to client). Nick Kew
// recommends to return APR_EGENERAL in hopes that the handler in control
// will notice and do The Right Thing. So, that is what we do now.
return APR_EGENERAL; return APR_EGENERAL;
} }