instead of using ap_bucket_read. It also lets ap_die handle the fact that
the filter returned the error.
Submitted by: Greg Stein
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87867
13f79535-47bb-0310-9956-
ffa450edef68
if (h == NULL) {
return NULL;
}
-
- h->start = apr_psprintf(p, "%d %s", error, buf);
+ h->status = error;
+ h->start = apr_pstrdup(p, buf);
b->length = strlen(h->start);
b->type = &ap_bucket_type_error;
return OK;
}
- if (APR_BRIGADE_FIRST(b)->type == &ap_bucket_type_error) {
- const char *str;
- apr_size_t length;
- apr_bucket_read(APR_BRIGADE_FIRST(b), &str, &length, APR_NONBLOCK_READ);
- ap_die(atoi(ap_getword_white(r->pool, &str)), r);
- return AP_FILTER_ERROR;
+ APR_BRIGADE_FOREACH(e, b) {
+ if (APR_BRIGADE_FIRST(b)->type == &ap_bucket_type_error) {
+ ap_bucket_error *eb = e->data;
+
+ ap_die(eb->status, r);
+ return AP_FILTER_ERROR;
+ }
}
if (r->assbackwards) {
char *custom_response = ap_response_code_string(r, error_index);
int recursive_error = 0;
+ if (type == AP_FILTER_ERROR) {
+ return;
+ }
+
if (type == DONE) {
ap_finalize_request_protocol(r);
return;
*/
ap_run_insert_filter(r);
- if ((access_status = ap_invoke_handler(r)) != 0 && access_status != -3) {
+ if ((access_status = ap_invoke_handler(r)) != 0) {
ap_die(access_status, r);
return;
}