You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Nathanael Noblet <na...@gnat.ca> on 2004/10/22 18:43:45 UTC

module filter vs handler

Quick question
	Can/Should something be designated as a filter AND a handler? For 
example the filter would pre-process the request such as POST data etc. 
The handler would work on what the filter setup? Or do I completely not 
understand the Apache module struct?

	Is there another place to discuss 3rd Party modules? the modules list 
given on the http://httpd.apache.org/lists.html doesn't exist anymore?

-- 
Nathanael D. Noblet
Gnat Solutions
204 - 131 Gorge Road E
Victoria, BC V9A 1L1

T/F 250.385.4613

http://www.gnat.ca/


Re: module filter vs handler

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 22 Oct 2004, Nathanael Noblet wrote:

> Quick question
> 	Can/Should something be designated as a filter AND a handler? For
> example the filter would pre-process the request such as POST data etc.
> The handler would work on what the filter setup? Or do I completely not
> understand the Apache module struct?

Yes.  Whether that makes sense or not depends on your application.
If they're not closely bound together, you might also implement them
as separate modules, so they're reusable in other applications.
My Site Valet application requires a minimum of 9 custom modules for
a full installation, and the website uses several additional ones.

You don't need an input filter to handle POST - though of course it's an
option.  You might want to look at existing handlers such as libapreq
or (for file upload forms) mod_upload ( http://apache.webthing.com/ ).

> 	Is there another place to discuss 3rd Party modules? the modules list
> given on the http://httpd.apache.org/lists.html doesn't exist anymore?

Well, it exists, but covalent seem to have more-or-less lost interest in
maintaining it (or modules.apache.org) in working order.  Subscribing to
it seems to be broken.

Does
	http://www.apachetutor.org/dev/request
help with understanding the architecture, from where you are on the
learning curve?

-- 
Nick Kew

Re: module filter vs handler

Posted by Nathanael Noblet <na...@gnat.ca>.
On Oct 22, 2004, at 12:11 PM, William A. Rowe, Jr. wrote:

> At 01:54 PM 10/22/2004, Nathanael Noblet wrote:
>
>>>>       Is there another place to discuss 3rd Party modules? the 
>>>> modules list given on the http://httpd.apache.org/lists.html 
>>>> doesn't exist anymore?
>>>
>>> Did you try apache-modules-subscribe@covalent.net?   We've rearranged
>>> some infrastructure, so I've asked Adam to research ASAP.
>>
>> I did try. The first time (yesterday or perhaps the day before) the 
>> subscribe request bounced. Today I tried again after your email, and 
>> I get a request for confirmation, which I reply to, and that is 
>> bounced now.
>
> Sorry, try now.  Spam filtering was in the way :(

That worked. Is there a http list archive available anywhere? the one I 
found stopped in may of 2003... Is the list still used? Much traffic 
etc?

-- 
Nathanael D. Noblet
Gnat Solutions
204 - 131 Gorge Road E
Victoria, BC V9A 1L1

T/F 250.385.4613

http://www.gnat.ca/


Re: module filter vs handler

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 01:54 PM 10/22/2004, Nathanael Noblet wrote:

>>>       Is there another place to discuss 3rd Party modules? the modules list given on the http://httpd.apache.org/lists.html doesn't exist anymore?
>>
>>Did you try apache-modules-subscribe@covalent.net?   We've rearranged
>>some infrastructure, so I've asked Adam to research ASAP.
>
>I did try. The first time (yesterday or perhaps the day before) the subscribe request bounced. Today I tried again after your email, and I get a request for confirmation, which I reply to, and that is bounced now.

Sorry, try now.  Spam filtering was in the way :(

Bill 


Re: module filter vs handler

Posted by Nathanael Noblet <na...@gnat.ca>.
On Oct 22, 2004, at 10:58 AM, William A. Rowe, Jr. wrote:

> At 11:43 AM 10/22/2004, Nathanael Noblet wrote:
>> Quick question
>>        Can/Should something be designated as a filter AND a handler? 
>> For example the filter would pre-process the request such as POST 
>> data etc. The handler would work on what the filter setup? Or do I 
>> completely not understand the Apache module struct?
>
> Depends on what you want to do.  The core handler can always do the
> heavy lifting for you, and better yet, if you replace the core
> when serving sql data or some other source, your 'filter' can still
> be run against the data.
>
> If your module -is- a data store (think an sql database, a compressed
> archive system, or something like that), then it most definitely
> should be a handler.

Well what I'm doing right now has to do with XML-RPC (Web services). I 
went through a couple tutorials, and have a handle on the handler 
method, no pun intended. Unfortunately, I don't know how to access the 
POST data that is sent. None of the data in the request_rec seems to 
hold that, or a method for me to pull it from a request_rec sub 
structure.

I realize that there are already XML-RPC implementations out there. I'm 
doing this as a learning exercise, a fun and frustrating exercise, but 
a learning exercise. I like the way that the module stuff is setup, I 
just can't figure the best way to get the POST data. The only tutorial 
on input filters is the one at onlamp.com which is only playing with 
the first header field, and doesn't give me enough information on how 
it registered itself or set itself up at the beginning. So I started 
disecting httpd-2.0.52/modules/experimental/mod_charset_lite.c to try 
to figure that out, as of a few minutes ago my version compiled, though 
does nothing as of yet... I'm hoping to see what data gets passed 
through the filter. Which still doesn't help me understand where the 
handler would get the information that the filter dealt with...

One more question. I see a lot of ap_log_rerror() function calls in 
this module and in a grep -r ap_log_rerror * of the source tree, but 
not in the Doxygen generated docs. Why is that? If it is depreciated 
what should I use to log message? Basically I want to debug via printf 
type statements... It helps me learn where/when each function is called 
and in what order, and what the structure status is when it is called 
etc...

>>        Is there another place to discuss 3rd Party modules? the 
>> modules list given on the http://httpd.apache.org/lists.html doesn't 
>> exist anymore?
>
> Did you try apache-modules-subscribe@covalent.net?   We've rearranged
> some infrastructure, so I've asked Adam to research ASAP.

I did try. The first time (yesterday or perhaps the day before) the 
subscribe request bounced. Today I tried again after your email, and I 
get a request for confirmation, which I reply to, and that is bounced 
now.


-- 
Nathanael D. Noblet
Gnat Solutions
204 - 131 Gorge Road E
Victoria, BC V9A 1L1

T/F 250.385.4613

http://www.gnat.ca/


Re: module filter vs handler

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 11:43 AM 10/22/2004, Nathanael Noblet wrote:
>Quick question
>        Can/Should something be designated as a filter AND a handler? For example the filter would pre-process the request such as POST data etc. The handler would work on what the filter setup? Or do I completely not understand the Apache module struct?

Depends on what you want to do.  The core handler can always do the
heavy lifting for you, and better yet, if you replace the core
when serving sql data or some other source, your 'filter' can still
be run against the data.

If your module -is- a data store (think an sql database, a compressed
archive system, or something like that), then it most definitely
should be a handler.

>        Is there another place to discuss 3rd Party modules? the modules list given on the http://httpd.apache.org/lists.html doesn't exist anymore?

Did you try apache-modules-subscribe@covalent.net?   We've rearranged 
some infrastructure, so I've asked Adam to research ASAP.

Thanks,

Bill