httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: input filter problem
Date Wed, 01 May 2013 14:20:28 GMT
> 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?


I didn't realize your handler returned DECLINED.  Either it will run
before the post body is read, or it will not run at all.  You can't
really write anything that runs before the real handler that also
notices something your input filter will change.  There is a module in
2.4 that allows the request body to be buffered, but I don't know much
about it. http://httpd.apache.org/docs/trunk/mod/mod_buffer.html

I guess it mostly depends on what you expect to do with the
information outside of the filter.

--
Eric Covener
covener@gmail.com

Mime
View raw message