httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: Earliest Hook to Inspect POST Params
Date Fri, 30 Jul 2004 15:20:30 GMT
Eli Marmor <marmor@netmask.it> writes:

> Hi,
> 
> Sorry if it's a newbie question, but I wondered what is the earliest
> hook that can be used for inspection of the POST parameters (apreq2, C).

It should be safe to use mod_apreq as soon as the request headers are 
parsed (which happens during the "Request Parsing Phase"):

    http://httpd.apache.org/docs-2.0/developer/request.html

> I'm not creating any content (so a normal handler is not needed), and
> I'm transparent and not modifying the request/response (so no filter is
> needed), but just logging the information and want to know what is the
> earliest phase that is already safe enough to parse the POST
> parameters.

Sounds to me like you really want to write a logging handler, which
is sort of the opposite question.

  "What's the latest hook that can be used?"

Any hook that runs before the content handler does should be fine.
If you're writing a log handler, all your pre-content-handler hook 
needs to do is call

  req = apreq_request(r, NULL);

This will register mod_apreq's input filter.  By the time your logging 
handler runs, the request body will be parsed, so the same call will 
provide your log handler with the fully parsed data.

> If there is an existing example, you may point me at that example
> instead of explaining.


There are a few example modules in httpd-apreq-2/env/c-modules


-- 
Joe Schaefer


Mime
View raw message