You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Nedelcho Stanev <ne...@atlanticsky.com> on 2003/05/23 13:03:35 UTC

How to attach user data to request_rec structure?

Hello,

I want to pass some data between modules, functions etc.
At all i want to write some flag or string for way of authentication
in authentication callback on my module and to get this data
latter in handler functions.
Does any know way to do  this with apache 2.0 ?

decho

Re: How to attach user data to request_rec structure?

Posted by Bill Stoddard <bi...@wstoddard.com>.
> Check out these examples from mod_cache:
>
> ap_set_module_config(r->request_config, &cache_module, cache);
> conf = (cache_server_conf *) 
> ap_get_module_config(r->server->module_config, &cache_module);


Ooops, that response was a little skitzo... :-)

Try this:
ap_set_module_config(r->request_config, &cache_module, cache);
cache = (cache_request_rec *) ap_get_module_config(r->request_config, 
&cache_module);

Bill


Re: How to attach user data to request_rec structure?

Posted by Bill Stoddard <bi...@wstoddard.com>.
Nedelcho Stanev wrote:

>Hello,
>
>I want to pass some data between modules, functions etc.
>At all i want to write some flag or string for way of authentication
>in authentication callback on my module and to get this data
>latter in handler functions.
>Does any know way to do  this with apache 2.0 ?
>
>decho
>
Check out these examples from mod_cache:

 ap_set_module_config(r->request_config, &cache_module, cache);
 conf = (cache_server_conf *) 
ap_get_module_config(r->server->module_config, &cache_module);

'cache' happens to be a pointer to a struct of type cache_server_conf. 
You can make it anything you want in your module.

Bill