diff --git a/apache2/apache2_io.c b/apache2/apache2_io.c index 1b3c5a9e..9ab15cb2 100644 --- a/apache2/apache2_io.c +++ b/apache2/apache2_io.c @@ -258,6 +258,9 @@ static apr_status_t send_error_bucket(ap_filter_t *f, int status) { apr_bucket_brigade *brigade = 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); 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); - // TODO: Should return an error if this function failed, but currently - // coded to pass this on as the filter return value. The calling code - // needs changed to return an error after checking this return value - // and possibly generating a log entry. - // - // 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. + /* NOTE: + * 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; }