When I encounter certain error conditions in my output filter, I would like to
return a specific error code/page (eg 503 - service not available). However,
the following code results in a 500 beeing returned to the browser:
apr_status_t my_out_filter(ap_filter_t *f, apr_bucket_brigade *bb)
{
....
if (I_should_return_503)
{
ap_remove_output_filter(f);
// f->r->status = HTTP_SERVICE_UNAVAILABLE;
return HTTP_SERVICE_UNAVAILABLE;
}
....
}
In fact, no matter what error code I return, the browser always gets a 500
error. Also, if I uncomment the "f->r->..." line, the browser gets an empty
(200) page.
Any suggestions?
Thanks in advance,
John