[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-modperl-cvs
Subject: cvs commit: modperl-2.0/src/modules/perl modperl_interp.c
From: dougm () apache ! org
Date: 2001-03-26 0:36:39
[Download RAW message or body]
dougm 01/03/25 16:36:39
Modified: src/modules/perl modperl_interp.c
Log:
look higher up the chain for the interpreter to share across subrequests
Revision Changes Path
1.29 +16 -4 modperl-2.0/src/modules/perl/modperl_interp.c
Index: modperl_interp.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- modperl_interp.c 2001/03/17 04:41:52 1.28
+++ modperl_interp.c 2001/03/26 00:36:39 1.29
@@ -212,13 +212,16 @@
*/
#define MP_INTERP_KEY "MODPERL_INTERP"
+#define get_interp(p) \
+(void)apr_pool_userdata_get((void **)&interp, MP_INTERP_KEY, p)
+
modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
server_rec *s)
{
MP_dSCFG(s);
modperl_config_dir_t *dcfg = modperl_config_dir_get(r);
const char *desc = NULL;
- modperl_interp_t *interp;
+ modperl_interp_t *interp = NULL;
apr_pool_t *p = NULL;
int is_subrequest = (r && r->main) ? 1 : 0;
modperl_interp_lifetime_e lifetime;
@@ -252,7 +255,7 @@
if (c && (lifetime == MP_INTERP_LIFETIME_CONNECTION)) {
desc = "conn_rec pool";
- (void)apr_pool_userdata_get((void **)&interp, MP_INTERP_KEY, c->pool);
+ get_interp(c->pool);
if (interp) {
MP_TRACE_i(MP_FUNC,
@@ -266,14 +269,23 @@
else if (r) {
if (is_subrequest && (lifetime == MP_INTERP_LIFETIME_REQUEST)) {
/* share 1 interpreter across sub-requests */
- p = r->main->pool;
+ request_rec *main_r = r->main;
+
+ while (main_r && !interp) {
+ p = main_r->pool;
+ get_interp(p);
+ MP_TRACE_i(MP_FUNC,
+ "looking for interp in main request for %s...%s\n",
+ main_r->uri, interp ? "found" : "not found");
+ main_r = main_r->main;
+ }
}
else {
p = r->pool;
+ get_interp(p);
}
desc = "request_rec pool";
- (void)apr_pool_userdata_get((void **)&interp, MP_INTERP_KEY, p);
if (interp) {
MP_TRACE_i(MP_FUNC,
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic