On 05/01/2013 04:23 PM, Eric Covener wrote:
However I'm unable to make my input filter function to be called before my
handler.

Input filters are normally called during the handler, when the handler
tries to read the request body through the filter chain.

  In your case, the body is probably not read until the core of Apache
sees it needs to discard the body the handler didn't read towards the
end of the request.    You'll need to read the body (see e.g.
mod_cgi.c near r->input_filters)


I understand that, however I don't understand how to make my module run the 
input_filters without consuming the request.

What I mean is that if I add the following, it will consume the actual request.

        rv = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES, 
APR_BLOCK_READ, HUGE_STRING_LEN);

        if (rv != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "Error reading request 
entity data");
            return HTTP_INTERNAL_SERVER_ERROR;
        }

        for (bucket = APR_BRIGADE_FIRST(bb); bucket != 
APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) {
            const char *data;
            apr_size_t len;

Do you have any suggestions?

Reply via email to