You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Samuel Vogel <sa...@gmx.de> on 2007/11/22 22:30:25 UTC

[users@httpd] mod_filter: and conjunction between two filters

Hey guys,

I have a question about mod_filter. I would like to run an output filter 
only if the content is not compressed and it's type is text/html. I have 
tried the following:

FilterDeclare addcomment
FilterProvider addcomment LAYOUT resp=Content-Encoding !$gzip
FilterProvider addcomment LAYOUT resp=Content-Type $text/html  
FilterChain addcomment

But this always ads the filter. Logically this is obvious, because the 
3. line ads the filter to every text/html document and does not care 
about the 2. line anymore. But I'm wondering how I could achive some 
kind of AND conjunction between the two rules ?

Regards,
Samy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Samuel Vogel <sa...@gmx.de>.
I did file a bug report:
http://issues.apache.org/bugzilla/show_bug.cgi?id=43956

I also tried what you suggested. Inflating the content if it's gzip and 
then running mod_layout.
But that did not work:

FilterDeclare removegzip CONTENT_SET
FilterProvider removegzip inflate resp=Content-Encoding $gzip
FilterProvider addcomment LAYOUT resp=Content-Type $text/html
FilterChain removegzip addcomment

It ran mod_layout on the crompressed pages which caused them to not 
display correctly.

Regards,
Samy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Nick Kew <ni...@webthing.com>.
On Sat, 24 Nov 2007 21:31:00 +0100
Samuel Vogel <sa...@gmx.de> wrote:

> Just another question:
> Would chaining the filters actually achieve what we want?

Yes.

An expression-parser in mod_filter would be a better solution,
though it would also require more work.

> We want to run mod_layout on all pages with Content-Type text/html 
> _except_ those which have Content-Encrytion gzip.

Why the latter exclusion?  You could use mod_deflate to uncompress
gzipped stuff.  Or if it's proxied, you can disallow gzipped stuff
from the backend.

>	 I'm not quite sure
> if chaining the filters would do this, so I'm asking before we put
> money into getting a bug fixed, which does not fix our problem.

It's more an enhancement request than a bugfix.  It's worth entering
in bugzilla regardless of what you decide to do.

> > Sounds Great. Problem is, that we are a German free host (kilu.de)
> > and do not display ads on the user pages. This is why we can not
> > support any real development efforts.

Heh.  There are far too many of us on shoestring business models.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Samuel Vogel <sa...@gmx.de>.
Just another question:
Would chaining the filters actually achieve what we want?

We want to run mod_layout on all pages with Content-Type text/html 
_except_ those which have Content-Encrytion gzip. I'm not quite sure if 
chaining the filters would do this, so I'm asking before we put money 
into getting a bug fixed, which does not fix our problem.

Does anybody know?

Regards,
Samy

Samuel Vogel schrieb:
> Sounds Great. Problem is, that we are a German free host (kilu.de) and 
> do not display ads on the user pages. This is why we can not support 
> any real development efforts.
> But if you say it could probably easily be fixed, I'm sure this would 
> be affordable from our side.
> Should we continue with this on list, or off-list ?
>
> Regards,
> Samy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Samuel Vogel <sa...@gmx.de>.
Sounds Great. Problem is, that we are a German free host (kilu.de) and 
do not display ads on the user pages. This is why we can not support any 
real development efforts.
But if you say it could probably easily be fixed, I'm sure this would be 
affordable from our side.
Should we continue with this on list, or off-list ?

Regards,
Samy

Nick Kew schrieb:
> On Fri, 23 Nov 2007 21:51:50 +0100
> Samuel Vogel <sa...@gmx.de> wrote:
>
>   
>>> The bad news (speaking from memory) is, I don't think that's
>>> fully implemented as of now (did you try it?).  I don't think
>>> I recollect seeing anyone ask for it before you did
>>>       
>> This unfortunately does not work.
>>     
>
> OK, my memory was correct.  I don't recollect why (this is from
> a little over three years ago), and I don't think it should be
> difficult to fix it.
>
>   
>> 	 And it does not only not work, it 
>> segfaults every apache process,
>>     
>
> Oops!
>
>   
>>   which is "affected" by the directive.
>> Who could I ask about implementing this feature?
>>     
>
> Do you have a budget?  If no, enter it in Bugzilla and take
> pot luck on when someone finds time for it.  If yes, I'm sure
> I could be persuaded to prioritise it.
>
> Or you could work around it.
>
>   

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 23 Nov 2007 21:51:50 +0100
Samuel Vogel <sa...@gmx.de> wrote:

> > The bad news (speaking from memory) is, I don't think that's
> > fully implemented as of now (did you try it?).  I don't think
> > I recollect seeing anyone ask for it before you did
> This unfortunately does not work.

OK, my memory was correct.  I don't recollect why (this is from
a little over three years ago), and I don't think it should be
difficult to fix it.

>	 And it does not only not work, it 
> segfaults every apache process,

Oops!

>   which is "affected" by the directive.
> Who could I ask about implementing this feature?

Do you have a budget?  If no, enter it in Bugzilla and take
pot luck on when someone finds time for it.  If yes, I'm sure
I could be persuaded to prioritise it.

Or you could work around it.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Samuel Vogel <sa...@gmx.de>.
> How it should work:
> FilterProvider foo LAYOUT resp=Content-Encoding !$gzip
> FilterProvider addcomment foo resp=Content-Type $text/html
>
> i.e. once you've declared foo, you can chain it by using it
> as a provider for your new filter.
>
> The bad news (speaking from memory) is, I don't think that's
> fully implemented as of now (did you try it?).  I don't think
> I recollect seeing anyone ask for it before you did
This unfortunately does not work. And it does not only not work, it 
segfaults every apache process, which is "affected" by the directive.
Who could I ask about implementing this feature?

This is what I tried:
FilterProvider gzip LAYOUT resp=Content-Encoding $!gzip
FilterProvider addcomment gzip resp=Content-Type $text/html

Regards,
Samy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Nick Kew <ni...@webthing.com>.
On Thu, 22 Nov 2007 22:30:25 +0100
Samuel Vogel <sa...@gmx.de> wrote:

> Hey guys,
> 
> I have a question about mod_filter. I would like to run an output
> filter only if the content is not compressed and it's type is
> text/html. I have tried the following:
> 
> FilterDeclare addcomment
> FilterProvider addcomment LAYOUT resp=Content-Encoding !$gzip
> FilterProvider addcomment LAYOUT resp=Content-Type $text/html  
> FilterChain addcomment
> 
> But this always ads the filter. Logically this is obvious, because
> the 3. line ads the filter to every text/html document and does not
> care about the 2. line anymore. But I'm wondering how I could achive
> some kind of AND conjunction between the two rules ?

How it should work:
FilterProvider foo LAYOUT resp=Content-Encoding !$gzip
FilterProvider addcomment foo resp=Content-Type $text/html

i.e. once you've declared foo, you can chain it by using it
as a provider for your new filter.

The bad news (speaking from memory) is, I don't think that's
fully implemented as of now (did you try it?).  I don't think
I recollect seeing anyone ask for it before you did!

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_filter: and conjunction between two filters

Posted by Samuel Vogel <sa...@gmx.de>.
Is it really not possible to connect 2 mod_filter matches? Isn't there 
some kind of workarround?

Regards,
Samy

Samuel Vogel schrieb:
> Hey guys,
>
> I have a question about mod_filter. I would like to run an output 
> filter only if the content is not compressed and it's type is 
> text/html. I have tried the following:
>
> FilterDeclare addcomment
> FilterProvider addcomment LAYOUT resp=Content-Encoding !$gzip
> FilterProvider addcomment LAYOUT resp=Content-Type $text/html  
> FilterChain addcomment
>
> But this always ads the filter. Logically this is obvious, because the 
> 3. line ads the filter to every text/html document and does not care 
> about the 2. line anymore. But I'm wondering how I could achive some 
> kind of AND conjunction between the two rules ?
>
> Regards,
> Samy
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org