You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ravi Prakash <ra...@otssolutions.com> on 2007/08/07 14:18:52 UTC
[users@httpd] r->notes among apache modules
Hi,
I am using r->notes to maintain values of some variables among apache
modules.
I am setting values in r->notes table in a module as follows:
/* Under Module A */
static int A_handler (request_rec *r)
{
apr_table_t *table=NULL;
table=apr_table_make(r->pool,1);
apr_table_set(r->notes,"MyNote","My Personal message to a module A ");
}
Now I want to read the value of "MyNote" in Module B.
/* Under Module B */
Static int B_Handler(request_rec *r)
{
Const char *data;
Data=apr_table_get(r->notes,"MyNote");
ap_rprintf((r, "<H1>%s </H1>",data);
}
I compiled the full source codes and inserted Both The modules successfully.
I opend the two Browsers and called Handler of Module A first and then on
2nd Brower, I called handler of Module B.
I got Null printed on 2nd Browser.
Can any one guess my fault, if I have any.
Plz guide me to right way , How can I access that value.
Thanks In Advance
Ravi
Re: [users@httpd] r->notes among apache modules
Posted by Eric Covener <co...@gmail.com>.
On 8/7/07, Ravi Prakash <ra...@otssolutions.com> wrote:
>
> Hi Eric,
>
> Well,
> I am designing a intranet web server for my internal office uses.
> The whole scheme is as below:-
>
>
> 1. A Request Listener Module accepts requests and sends back response.
> 2. This Listener Module checks the Content-Type of each request.
> 3. based on that content-type , it passes the whole information to specific
> module particularly for that service.(Here I have to use r->notes to pass
> data from Listener Module to service modules)
>
> 4. service Modules again responds to Listener Module with response.(Again
> here, I have to use r->Notes for passing data from service Module to
> Listener Module.
>
> 5. Now listener Module accepts the data from r->notes (as set by service
> modules) and sends it to client.
>
> So,
> Listener Module is acting as an intermediate Gateway.
You should probably take the discussion to
modules-dev@httpd.apache.org. I also think you might have better luck
sticking closer to the apache API instead of trying to work around it.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] r->notes among apache modules
Posted by Ravi Prakash <ra...@otssolutions.com>.
Hi Eric,
Well,
I am designing a intranet web server for my internal office uses.
The whole scheme is as below:-
1. A Request Listener Module accepts requests and sends back response.
2. This Listener Module checks the Content-Type of each request.
3. based on that content-type , it passes the whole information to specific
module particularly for that service.(Here I have to use r->notes to pass
data from Listener Module to service modules)
4. service Modules again responds to Listener Module with response.(Again
here, I have to use r->Notes for passing data from service Module to
Listener Module.
5. Now listener Module accepts the data from r->notes (as set by service
modules) and sends it to client.
So,
Listener Module is acting as an intermediate Gateway.
Eric, This is the whole scenario , for which I am not getting solution.
Thanks for your Co-operation
Ravi
-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Tuesday, August 07, 2007 6:39 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] r->notes among apache modules
On 8/7/07, Ravi Prakash <ra...@otssolutions.com> wrote:
> Hi Eric ,
>
> Can u suggest some nice technique to achieve , what I am looking for.
>
> It will be appreciated .
You haven't specified enough. Surely there's precedent for what you're
doing in some other apache module.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] r->notes among apache modules
Posted by Eric Covener <co...@gmail.com>.
On 8/7/07, Ravi Prakash <ra...@otssolutions.com> wrote:
> Hi Eric ,
>
> Can u suggest some nice technique to achieve , what I am looking for.
>
> It will be appreciated .
You haven't specified enough. Surely there's precedent for what you're
doing in some other apache module.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] r->notes among apache modules
Posted by Ravi Prakash <ra...@otssolutions.com>.
Hi Eric ,
Can u suggest some nice technique to achieve , what I am looking for.
It will be appreciated .
-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Tuesday, August 07, 2007 6:06 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] r->notes among apache modules
On 8/7/07, Ravi Prakash <ra...@otssolutions.com> wrote:
> I am using r->notes to maintain values of some variables among apache
> modules.
>
..
> I opend the two Browsers and called Handler of Module A first and then on
> 2nd Brower, I called handler of Module B.
>
> I got Null printed on 2nd Browser.
>
r->notes is in the request_rec which is scoped to individual requests.
You shouldn't expect to be able to read the data back on an unrelated
request.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] r->notes among apache modules
Posted by Eric Covener <co...@gmail.com>.
On 8/7/07, Ravi Prakash <ra...@otssolutions.com> wrote:
> I am using r->notes to maintain values of some variables among apache
> modules.
>
..
> I opend the two Browsers and called Handler of Module A first and then on
> 2nd Brower, I called handler of Module B.
>
> I got Null printed on 2nd Browser.
>
r->notes is in the request_rec which is scoped to individual requests.
You shouldn't expect to be able to read the data back on an unrelated
request.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org