perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkal...@apache.org
Subject svn commit: r1503193 - in /perl/modperl/branches/httpd24/src/modules/perl: modperl_interp.c modperl_util.c
Date Mon, 15 Jul 2013 12:03:58 GMT
Author: jkaluza
Date: Mon Jul 15 12:03:58 2013
New Revision: 1503193

URL: http://svn.apache.org/r1503193
Log:
Return NULL in modperl_interp_pool_select in case scfg->mip is not defined.
Handle that situation in modperl_util.

Modified:
    perl/modperl/branches/httpd24/src/modules/perl/modperl_interp.c
    perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c

Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_interp.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_interp.c?rev=1503193&r1=1503192&r2=1503193&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_interp.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_interp.c Mon Jul 15 12:03:58 2013
@@ -351,6 +351,13 @@ modperl_interp_t *modperl_interp_pool_se
              * before server merge.
              */
             modperl_init_vhost(s, p, NULL);
+            if (!scfg->mip) {
+                /* FIXME: We get here if global "server_rec" == s, scfg->mip
+                 * is not created then. I'm not sure if that's bug or 
+                 * bad/good design decicision. For now just return NULL.
+                 */
+                return NULL;
+            }
         }
 
         interp = scfg->mip->parent;

Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c?rev=1503193&r1=1503192&r2=1503193&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_util.c Mon Jul 15 12:03:58 2013
@@ -994,43 +994,44 @@ static const char *perl_parse_require_li
     int count;
     void *key;
     auth_callback *ab;
-    modperl_interp_t *interp = NULL;
+    modperl_interp_t *interp = modperl_interp_pool_select(cmd->server->process->pool,
cmd->server);
+    if (interp) {
+        dTHXa(interp->perl);
+        dSP;
 
-    if (global_authz_providers == NULL) {
-        return ret;
-    }
-
-    apr_pool_userdata_get(&key, AUTHZ_PROVIDER_NAME_NOTE, cmd->temp_pool);
-    ab = apr_hash_get(global_authz_providers, (char *) key, APR_HASH_KEY_STRING);
-    if (ab == NULL || ab->cb2 == NULL) {
-        return ret;
-    }
+        if (global_authz_providers == NULL) {
+            return ret;
+        }
 
-    modperl_interp_pool_select(cmd->server->process->pool, cmd->server);
-    dTHXa(interp->perl);
-    dSP;
-    ENTER;
-    SAVETMPS;
-    PUSHMARK(SP);
-    XPUSHs(sv_2mortal(modperl_ptr2obj(aTHX_ "Apache2::CmdParms", cmd)));
-    XPUSHs(sv_2mortal(newSVpv(require_line, 0)));
-    PUTBACK;
-    count = call_sv(ab->cb2, G_SCALAR);
-    SPAGAIN;
+        apr_pool_userdata_get(&key, AUTHZ_PROVIDER_NAME_NOTE, cmd->temp_pool);
+        ab = apr_hash_get(global_authz_providers, (char *) key, APR_HASH_KEY_STRING);
+        if (ab == NULL || ab->cb2 == NULL) {
+            return ret;
+        }
 
-    if (count == 1) {
-        ret_sv = POPs;
-        if (SvOK(ret_sv)) {
-            char *tmp = SvPV_nolen(ret_sv);
-            if (*tmp != '\0') {
-                ret = apr_pstrdup(cmd->pool, tmp);
+        ENTER;
+        SAVETMPS;
+        PUSHMARK(SP);
+        XPUSHs(sv_2mortal(modperl_ptr2obj(aTHX_ "Apache2::CmdParms", cmd)));
+        XPUSHs(sv_2mortal(newSVpv(require_line, 0)));
+        PUTBACK;
+        count = call_sv(ab->cb2, G_SCALAR);
+        SPAGAIN;
+
+        if (count == 1) {
+            ret_sv = POPs;
+            if (SvOK(ret_sv)) {
+                char *tmp = SvPV_nolen(ret_sv);
+                if (*tmp != '\0') {
+                    ret = apr_pstrdup(cmd->pool, tmp);
+                }
             }
         }
-    }
 
-    PUTBACK;
-    FREETMPS;
-    LEAVE;
+        PUTBACK;
+        FREETMPS;
+        LEAVE;
+    }
     return ret;
 }
 



Mime
View raw message