httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Hjalmarsson" <>
Subject Trouble with filter-module, function called multiple times
Date Sun, 05 Apr 2009 09:18:27 GMT


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 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:


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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message