You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Andrej van der Zee <an...@gmail.com> on 2009/03/16 14:13:22 UTC

hook before receiving HTTP request

Hi,

I am looking for a hook function that I can call to initialize some
structures before it accepts a connections. Similar like
ap_log_transaction() is called after the HTTP reply is sent to the
client, I need a hook that is called before a HTTP request is
received. Is it there?

Thank you,
Andrej

Re: hook before receiving HTTP request

Posted by Andrej van der Zee <an...@gmail.com>.
Hi,

>
> http://httpd.apache.org/docs/2.2/developer/modules.html
>
> ap_hook_pre_connection
>    do any setup required just before processing, but after accepting
>
> ap_hook_create_request
>    ??
>
> (Assuming) ap_hook_create_request will be called when creating a request_rec
> * for each request on a connection (multiple request on a connection with
> KeepAlive enabled).
>
> Is that what you are looking for?

Well, I saw those hooks too, but I think it is not exactly what I
want. I need to hook into my module EVERY time before receiving a
request. I need to do some general initialization before every HTTP
request, but I do not want to disturb the request processing itself,
in terms of performance loss. But I guess it is not there so I will
start looking for another solution.

Cheers,
Andrej

Re: hook before receiving HTTP request

Posted by "Brian J. France" <li...@firehawksystems.com>.
On Mar 16, 2009, at 9:13 AM, Andrej van der Zee wrote:
> I am looking for a hook function that I can call to initialize some
> structures before it accepts a connections. Similar like
> ap_log_transaction() is called after the HTTP reply is sent to the
> client, I need a hook that is called before a HTTP request is
> received. Is it there?

http://httpd.apache.org/docs/2.2/developer/modules.html

ap_hook_pre_connection
     do any setup required just before processing, but after accepting

ap_hook_create_request
     ??

(Assuming) ap_hook_create_request will be called when creating a  
request_rec * for each request on a connection (multiple request on a  
connection with KeepAlive enabled).

Is that what you are looking for?

Brian