httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Corcoran" <>
Subject Access request_rec from a connection filter in Apache 2.0
Date Sat, 18 Jan 2003 01:57:33 GMT


I have a connection filter of type AP_FTYPE_NETWORK which gets called
just before the core output filter.  I have placed it here to get at
(read only) the raw output of the server for a given request.  The
problem that I am facing is that when my filter callback gets called,
there is no reference available to the current request (f->r == NULL).
All I get is a reference to the connection (f->c != NULL).

I would like to have some sort of "request context" within my filter
callback, primarily so that I can access
ap_get_module_config(f->r->request_config, &m) and retrieve data that I
set in a previous stage (like the fixup stage).

I'm not too sure of the best way to do this, or if it even makes sense
given the structure of Apache 2.0 filtering.  But basically, what I'm
looking for is to access to the raw output of the server (full Headers
and Body) and be able to associate that content (or bucket brigade) with
a request_rec from within a filter callback.

I've done the following as a hack:

    ap_set_module_config(r->conn_config, &my_module, r);

right in the fixup phase after determining if I should care about this
request.  And then, within the filter, I do a:

    request_rec *r = ap_get_module_config(c->conn_config, &my_module);

This works for, but I'm pretty sure that there would be problems with

Any thoughts??

Thanks for the help.
Mike C.

View raw message