Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 13250 invoked from network); 5 Apr 2009 14:29:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Apr 2009 14:29:36 -0000 Received: (qmail 11174 invoked by uid 500); 5 Apr 2009 14:29:35 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 11121 invoked by uid 500); 5 Apr 2009 14:29:35 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 11111 invoked by uid 99); 5 Apr 2009 14:29:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Apr 2009 14:29:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ashishrk@gmail.com designates 209.85.200.169 as permitted sender) Received: from [209.85.200.169] (HELO wf-out-1314.google.com) (209.85.200.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Apr 2009 14:29:25 +0000 Received: by wf-out-1314.google.com with SMTP id 24so1724386wfg.15 for ; Sun, 05 Apr 2009 07:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Q4NpHqk51D+VrxcN4J/SIyzNOPs9prqMdzTDzlj7vZg=; b=BoD82HOL5+fWAXlk7DIzbuwT2gHVs5Ju0tbdQfqqLsW1EgdsfFsPZ7xGgu0cEhAK79 T3yV9RDxHuOQSZI/KxwUZ6i3qCBVepmL6w3JUtJh5iTe9SaWRjfqk2V6iXHBh/cPwPCp RWrQ4SkduZVMSQ9TEtm5Nwoky3AogAP+mzDRs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=h5+qb7ILbok59fnUOBoQFvTtIdhfKnAjZlaSI97c08dZWYj+w5bMDcJuxIwaYbwrIF 4KrpgSzXYvkG/dbZDaVsa8X+ewmy0ZgaSsMDBga8ScA1p0YArYcX5rl6LUbwztZLYFt4 pBK0J+AW5XxBVAMTnRvNsL2/YXzm1NVmmfo2c= MIME-Version: 1.0 Received: by 10.142.241.15 with SMTP id o15mr978438wfh.104.1238941743186; Sun, 05 Apr 2009 07:29:03 -0700 (PDT) In-Reply-To: <000901c9b5cf$7a90af90$6fb20eb0$@se> References: <000901c9b5cf$7a90af90$6fb20eb0$@se> Date: Sun, 5 Apr 2009 19:59:03 +0530 Message-ID: Subject: Re: Trouble with filter-module, function called multiple times From: Ashish Khare To: modules-dev@httpd.apache.org Content-Type: multipart/alternative; boundary=000e0cd146908004100466cf9a72 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd146908004100466cf9a72 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Just try this... After your filter functionality , remove the filter from the chain... On Sun, Apr 5, 2009 at 2:48 PM, Alexander Hjalmarsson wrote: > Hi > > > > I have a problem in a filter module I've created. The module works as > following: It searches for the first body-tag of the page, and if it is > found, it inserts a piece of code there. If there is no body tag found > (), it inserts the code at the top of the page instead. However I > have > troubles with this.. In my filter-function, I have an int that I set to 1 > if > the body is found and it is set to 0 if the body is not found. Then I use > this later in the function in an if statement, so if the int is 0, the code > should be inserted at the top, otherwise not. > > > > The problem with this seems to be that this function is for some pages > called three of four times and it looks like it is "forked" or something > and > splits up the content and separates them and goes through the function > three > or four times and because of this, the code can appear more times on one > page since in the first piece of the page it will find the body and insert > after that, but in the other pieces it will just try to insert on the "top" > of that piece since the body tag is not found, which results in broken > pages > etc because it can appear anywhere. > > > > It looks like it's only affecting php-scripts and I guess it can have > something to do with includes, but I have not found anything to go from. I > have tried including files for myself in some test-scripts, but it works as > it should there, so I just don't know whats wrong. > > > > What can be wrong here and how can I do to make sure that one whole page > just passes the filter-function once before it goes to the client? I'm > doing > this with buckets and the whole filter is much like this: > > http://apache.webthing.com/mod_txt/mod_txt.c > > > > The function I am talking about is the static int txt_filter(.) > > > > I would really love some help here and I know my English isn't the best, so > if you have any questions just ask me and I'll answer.. Thank you very > muchJ > > --000e0cd146908004100466cf9a72--