perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject svn commit: r123158 - perl/modperl/trunk/src/modules/perl
Date Thu, 23 Dec 2004 00:46:40 GMT
Author: gozer
Date: Wed Dec 22 16:46:39 2004
New Revision: 123158

URL: http://svn.apache.org/viewcvs?view=rev&rev=123158
Log:
Simplified the implementation of PerlPostConfigRequire. Stashing
the Perl interpreter was a waste of time, when it's always available
to us thru scfg->mip->parent->perl.


Modified:
   perl/modperl/trunk/src/modules/perl/mod_perl.c
   perl/modperl/trunk/src/modules/perl/modperl_cmd.c
   perl/modperl/trunk/src/modules/perl/modperl_config.c
   perl/modperl/trunk/src/modules/perl/modperl_config.h
   perl/modperl/trunk/src/modules/perl/modperl_types.h

Modified: perl/modperl/trunk/src/modules/perl/mod_perl.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/mod_perl.c?view=diff&rev=123158&p1=perl/modperl/trunk/src/modules/perl/mod_perl.c&r1=123157&p2=perl/modperl/trunk/src/modules/perl/mod_perl.c&r2=123158
==============================================================================
--- perl/modperl/trunk/src/modules/perl/mod_perl.c	(original)
+++ perl/modperl/trunk/src/modules/perl/mod_perl.c	Wed Dec 22 16:46:39 2004
@@ -327,10 +327,6 @@
         exit(1);
     }
 
-    if (!modperl_config_prepare_PerlPostConfigRequire(s, scfg, perl, p)) {
-        exit(1);   
-    }
-
 #ifndef USE_ITHREADS
     cdata = modperl_cleanup_data_new(server_pool, (void*)perl);
     apr_pool_cleanup_register(server_pool, cdata,
@@ -416,10 +412,6 @@
         }
 
         if (!modperl_config_apply_PerlModule(s, scfg, perl, p)) {
-            return HTTP_INTERNAL_SERVER_ERROR;
-        }
-
-        if (!modperl_config_prepare_PerlPostConfigRequire(s, scfg, perl, p)) {
             return HTTP_INTERNAL_SERVER_ERROR;
         }
     }

Modified: perl/modperl/trunk/src/modules/perl/modperl_cmd.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_cmd.c?view=diff&rev=123158&p1=perl/modperl/trunk/src/modules/perl/modperl_cmd.c&r1=123157&p2=perl/modperl/trunk/src/modules/perl/modperl_cmd.c&r2=123158
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_cmd.c	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_cmd.c	Wed Dec 22 16:46:39 2004
@@ -249,18 +249,10 @@
 
     if (APR_SUCCESS == apr_stat(&finfo, arg, APR_FINFO_TYPE, p)) {
         if (finfo.filetype != APR_NOFILE) {
-             modperl_require_file_t *require = apr_pcalloc(p, sizeof(*require));
-#ifdef USE_ITHREADS
-            if (modperl_is_running()) {
-                require->perl = scfg->mip->parent->perl;
-            }
-#endif
-            require->file = arg;
-
             MP_TRACE_d(MP_FUNC, "push PerlPostConfigRequire for %s\n", arg);
 
-            *(modperl_require_file_t **)
-                apr_array_push(scfg->PerlPostConfigRequire) = require;
+            *(const char **)
+                apr_array_push(scfg->PerlPostConfigRequire) = arg;
         }
     }
     else {

Modified: perl/modperl/trunk/src/modules/perl/modperl_config.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_config.c?view=diff&rev=123158&p1=perl/modperl/trunk/src/modules/perl/modperl_config.c&r1=123157&p2=perl/modperl/trunk/src/modules/perl/modperl_config.c&r2=123158
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_config.c	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_config.c	Wed Dec 22 16:46:39 2004
@@ -155,8 +155,7 @@
 
     scfg->PerlModule  = apr_array_make(p, 2, sizeof(char *));
     scfg->PerlRequire = apr_array_make(p, 2, sizeof(char *));
-    scfg->PerlPostConfigRequire =
-        apr_array_make(p, 1, sizeof(modperl_require_file_t *));
+    scfg->PerlPostConfigRequire = apr_array_make(p, 1, sizeof(char *));
 
     scfg->argv = apr_array_make(p, 2, sizeof(char *));
 
@@ -444,57 +443,32 @@
                                                modperl_config_srv_t *scfg,
                                                apr_pool_t *p)
 {
-    modperl_require_file_t **requires;
+    char **requires;
     int i;
     MP_PERL_CONTEXT_DECLARE;
 
-    MP_PERL_CONTEXT_STORE;
-    
-    requires = (modperl_require_file_t **)scfg->PerlPostConfigRequire->elts;
+    requires = (char **)scfg->PerlPostConfigRequire->elts;
     for (i = 0; i < scfg->PerlPostConfigRequire->nelts; i++){
-#ifdef USE_ITHREADS
-        aTHX = requires[i]->perl;
-#endif
-        if (modperl_require_file(aTHX_ requires[i]->file, TRUE)){
+        int retval;
+
+        MP_PERL_CONTEXT_STORE_OVERRIDE(scfg->mip->parent->perl);
+        retval = modperl_require_file(aTHX_ requires[i], TRUE);
+        MP_PERL_CONTEXT_RESTORE;
+
+        if (retval) {
             MP_TRACE_d(MP_FUNC, "loaded Perl file: %s for server %s\n",
-                       requires[i]->file, modperl_server_desc(s, p));
+                       requires[i], modperl_server_desc(s, p));
         }
         else {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
                          "Can't load Perl file: %s for server %s, exiting...",
-                         requires[i]->file, modperl_server_desc(s, p));
-            MP_PERL_CONTEXT_RESTORE;
+                         requires[i], modperl_server_desc(s, p));
+            
             return FALSE;
         }
     }
-    MP_PERL_CONTEXT_RESTORE;
 
     return TRUE;
-}
-
-/* In the case where files were added when interpreters were not yet started,
- * we need to go over the existing files and assign them the correct interpreter
- */
-int modperl_config_prepare_PerlPostConfigRequire(server_rec *s,
-                                                 modperl_config_srv_t *scfg,
-                                                 PerlInterpreter *perl,
-                                                 apr_pool_t *p)
-{
-#ifdef USE_ITHREADS
-    modperl_require_file_t **requires;
-    int i;
-
-    requires = (modperl_require_file_t **)scfg->PerlPostConfigRequire->elts;
-    for (i = 0; i < scfg->PerlPostConfigRequire->nelts; i++) {
-        if (!requires[i]->perl) {
-            MP_TRACE_d(MP_FUNC, "Late binding of %s to an interpreter",
-                   requires[i]->file);
-            requires[i]->perl = perl;
-        }
-    }
-#endif
-
-    return 1;
 }
 
 typedef struct {

Modified: perl/modperl/trunk/src/modules/perl/modperl_config.h
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_config.h?view=diff&rev=123158&p1=perl/modperl/trunk/src/modules/perl/modperl_config.h&r1=123157&p2=perl/modperl/trunk/src/modules/perl/modperl_config.h&r2=123158
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_config.h	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_config.h	Wed Dec 22 16:46:39 2004
@@ -122,11 +122,6 @@
                                      modperl_config_srv_t *scfg,
                                      PerlInterpreter *perl, apr_pool_t *p);
 
-int modperl_config_prepare_PerlPostConfigRequire(server_rec *s,
-                                                 modperl_config_srv_t *scfg,
-                                                 PerlInterpreter *perl,
-                                                 apr_pool_t *p);
-
 int modperl_config_apply_PerlPostConfigRequire(server_rec *s,
                                                modperl_config_srv_t *scfg,
                                                apr_pool_t *p);

Modified: perl/modperl/trunk/src/modules/perl/modperl_types.h
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_types.h?view=diff&rev=123158&p1=perl/modperl/trunk/src/modules/perl/modperl_types.h&r1=123157&p2=perl/modperl/trunk/src/modules/perl/modperl_types.h&r2=123158
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_types.h	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_types.h	Wed Dec 22 16:46:39 2004
@@ -39,13 +39,6 @@
     server_rec  *s;
 } modperl_rcs_t;
 
-typedef struct {
-    const char *file;
-#ifdef USE_ITHREADS
-    PerlInterpreter *perl;
-#endif
-} modperl_require_file_t;
-
 #ifdef USE_ITHREADS
 
 typedef struct modperl_list_t modperl_list_t;

Mime
View raw message