httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Hjalmarsson" <>
Subject RE: Trouble with filter-module, function called multiple times
Date Sun, 05 Apr 2009 15:20:50 GMT
Thank you for your answer!

I actually solved it now with usage of the ctx-thing and it was really
perfect. However I do wonder if there is any API documentation for module
developing? I haven't found anything that's really useful, such as the java
API or something..

Thanks :)

-----Original Message-----
From: Ashish Khare [] 
Sent: den 5 april 2009 16:29
Subject: Re: Trouble with filter-module, function called multiple times

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
> (<body>), 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
> 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
> 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
> 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:
> 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,
> if you have any questions just ask me and I'll answer.. Thank you very
> muchJ

View raw message