httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Johanson" <>
Subject output filter needs to redirect to 503 error status
Date Thu, 16 Oct 2014 13:36:19 GMT
I have an output filter module which is working just fine, but I need to add
a feature so that when certain error conditions occur during processing, the
output filter hook function redirects the whole request to a 503 error
status (service unavailable).  Obviously for a "handler" module this is
trivial to accomplish, but it is not clear how to do this in an output
filter module.

My output filter hooked function is defined as follows:
       apr_status_t mts_out_filter(ap_filter_t *f,apr_bucket_brigade *bb)

I need this function to "do something" that causes the whole request to be
redirected such that the client sees a 503 error status with no

Things that I've tried so far:
* Returning HTTP_SERVICE_UNAVAILABLE from the output filter function after
calling "ap_pass_brigade(f->next,bb)"
* Setting f->r->status to HTTP_SERVICE_UNAVAILABLE after calling
* calling "ap_send_error_response(f->r,HTTP_SERVICE_UNAVAILABLE)"

None of these really seem to behave properly.  I just want the client to
receive a 503 error status with no content body.  There must be a way to
achieve this behavior from within an output filter hook?

Any advice is appreciated.
Thanks, -Eric

View raw message