Author: torsten
Date: Tue Feb  7 19:50:47 2012
New Revision: 1241583

URL: http://svn.apache.org/viewvc?rev=1241583&view=rev
Log:
modperl_interp_pool_select() when used to create or merge dir-configs
at runtime may pull the interpreter from the wrong pool if the request's
server is a vhost with a separate interpreter pool.

Modified:
    perl/modperl/branches/threading/Changes
    perl/modperl/branches/threading/src/modules/perl/modperl_interp.c

Modified: perl/modperl/branches/threading/Changes
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/threading/Changes?rev=1241583&r1=1241582&r2=1241583&view=diff
==============================================================================
--- perl/modperl/branches/threading/Changes (original)
+++ perl/modperl/branches/threading/Changes Tue Feb  7 19:50:47 2012
@@ -12,6 +12,12 @@ Also refer to the Apache::Test changes l
 
 =item 2.0.6-threading
 
+Make sure modperl_interp_select uses r->server rather than the passed s
+parameter to find the interpreter pool to pull an interpreter from. This
+fixes an issue with vhosts with a separate interpreter pool and runtime
+dir-config merges that used to pull the interpreter from the wrong pool.
+[Torsten Foertsch]
+
 PerlInterpScope is now more advisory. Using $(c|r)->pnotes will bind
 the current interpreter to that object for it's lifetime.
 $(c|r)->pnotes_kill() can be used to prematurely drop pnotes and

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_interp.c
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_interp.c?rev=1241583&r1=1241582&r2=1241583&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_interp.c (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_interp.c Tue Feb  
7 19:50:47 2012
@@ -399,14 +399,14 @@ modperl_interp_t *modperl_interp_pool_se
         ap_assert(r);
         MP_TRACE_i(MP_FUNC, "found userdata MODPERL_R in pool %#lx as %lx",
                    (unsigned long)r->pool, (unsigned long)r);
-        return modperl_interp_select(r, NULL, s);
+        return modperl_interp_select(r, NULL, NULL);
     }
 }
 
 modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
                                         server_rec *s)
 {
-    MP_dSCFG((s ? s : r ? r->server : NULL));
+    MP_dSCFG((r ? s=r->server : s ? s : NULL));
     MP_dDCFG;
     modperl_config_con_t *ccfg;
     const char *desc = NULL;
@@ -443,7 +443,10 @@ modperl_interp_t *modperl_interp_select(
         return ccfg->interp;
     }
 
-    interp = modperl_interp_get(s ? s : r->server);
+    MP_TRACE_i(MP_FUNC,
+               "fetching interp for (%s:%d)", s->server_hostname, s->port);
+    interp = modperl_interp_get(s);
+    MP_TRACE_i(MP_FUNC, "  --> got %pp", interp);
     ++interp->num_requests; /* should only get here once per request */
     interp->refcnt = 0;
 


Reply via email to