Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 98472 invoked by uid 500); 19 Sep 2000 14:49:47 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 98337 invoked from network); 19 Sep 2000 14:49:26 -0000 X-Authentication-Warning: koj: rbb owned process doing -bs Date: Tue, 19 Sep 2000 02:46:35 -0700 (PDT) From: rbb@covalent.net X-Sender: rbb@koj To: new-httpd@apache.org Subject: Re: AddOutputFilter hook needed? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > Let's ignore for a moment the particular hook where the module's ap_add_filter() > call is coded. > > Let's say that a module implements logic to decide to insert a filter > during some other hook. When the module is configured to perform a > certain operation, its filter must be inserted. If there is an > AddOutputFilter statement, the module is happy to stay out of mucking > with the filter chain. If there is no AddOutputFilter statement, the > module wants to call ap_add_filter() to insert the filter. Otherwise, > the module can't possibly perform the requested operation. > > How does the module know that there is an AddOutputFilter directive > and that the module should not add its filter implicitly? > > If the module doesn't need to know, how do we keep the filter from > being added more than once? (AddOutputFilter processing could > supercede any ap_add_filter() calls from modules.) My current thinking is to punt this issue to the module itself. I am thinking that filters that shouldn't be added twice will just keep track of if they have ever been called for this request, and remove themselves from the stack if they have already been called once. This actually wouldn't be that hard to implement, and it leaves a lot of flexibility to the modules to determine how many times they should be called for a request. This also has another advantageous feature. It delays the decision until we are running the filter stack. This means that there is no opportunity for a filter to be added after the check, because the call to the filter IS the check. Ryan _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------