httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [apache-2.1.3] buffering content in input filter
Date Wed, 12 Jan 2005 16:43:22 GMT
Pawel Niewiadomski wrote:
> hello,
> I'm writing an input filter that needs to operate on a full content
> of incoming request. But it should not pass incoming data to other
> input filters - it gathers full body of request, changes it and then
> passes it further.
> 
> I have one problem - if I empty a brigade that is passed to the input filter
> it is not called again.
> I read that free brigades mean that input is ended. If I leave a byte in the
> brigade everything works ok - input filter is called until
> EOS and I can dump previously gathered content. But I don't want to
> add these bytes. 
> 
> Does anyone know how can I solve this problem?
> 

Instead of returning empty brigades up the stream, you can gobble up all 
incoming data by issuing your own ap_get_brigade calls. I don't have 
example in C, but you can see how it's done in perl:
t/filter/TestFilter/in_bbs_consume.pm
http://svn.apache.org/viewcvs.cgi/perl/modperl/trunk/t/filter/TestFilter/in_bbs_consume.pm?rev=106958&view=markup

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message