Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 63557 invoked from network); 12 Jan 2005 16:43:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 12 Jan 2005 16:43:35 -0000 Received: (qmail 31082 invoked by uid 500); 12 Jan 2005 16:43:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 31030 invoked by uid 500); 12 Jan 2005 16:43:27 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 31012 invoked by uid 99); 12 Jan 2005 16:43:27 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.logilune.com (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 12 Jan 2005 08:43:25 -0800 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 29CC21E1D15 for ; Wed, 12 Jan 2005 17:43:23 +0100 (CET) Message-ID: <41E553AA.8080602@stason.org> Date: Wed, 12 Jan 2005 11:43:22 -0500 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: [apache-2.1.3] buffering content in input filter References: <20050112131036.1851.qmail@sarp.org.pl> In-Reply-To: <20050112131036.1851.qmail@sarp.org.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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