httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: ap_hook_create_request vs ap_hook_insert_filter
Date Mon, 04 Jul 2011 03:34:23 GMT

On 4 Jul 2011, at 01:24, Jodi Bosa wrote:

> Hi,
> In Apache 2.2 - what is the purpose of ap_hook_insert_filter?   It seems to
> get invoked after things like post_read, quick_handler, and others which is
> too late to "filter" any input.
> On the other hand, ap_hook_create_request does get invoked early enough.

The insert_filter hook is indeed too late to insert 'outer' input filters that will
affect the protocol.  But it's plenty early enough for other filters.

The request_rec represents the HTTP(s) protocols.   If you're using HTTPD's 
own protocol support then your filters won't mess with it, so they don't need
to be inserted early.  If you do want to mess with the protocol at a low level
then yes, you'll want a create_request hook.

The reason for the hook coming late in the cycle is that filter configuration
may depend on the outcome of earlier phases (and in general WILL depend
on at least the configuration walk).

Nick Kew

Available for work, contract or permanent

View raw message