You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/01/16 07:59:52 UTC

[patch] removing redundant perlmodule/perlrequire calls

I think we don't need these calls, they are already called from 
modperl_startup() for vhosts that need their own parent perl interpreter.

Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.104
diff -u -r1.104 mod_perl.c
--- src/modules/perl/mod_perl.c	9 Jan 2002 00:31:39 -0000	1.104
+++ src/modules/perl/mod_perl.c	16 Jan 2002 06:55:06 -0000
@@ -265,13 +265,6 @@
                         modperl_server_desc(s, p));
          }

-        if (!modperl_config_apply_PerlModule(s, scfg, perl, p)) {
-            exit(1);
-        }
-        if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
-            exit(1);
-        }
-
  #ifdef USE_ITHREADS

          if (!MpSrvENABLE(scfg)) {


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] removing redundant perlmodule/perlrequire calls

Posted by Stas Bekman <st...@stason.org>.
>>I think we don't need these calls, they are already called from 
>>modperl_startup() for vhosts that need their own parent perl interpreter.
>>
> 
> that would mean Perl{Require,Module} would not be applied in a vhost that
> shares the parent interpreter.  for example, this would be ignored:
>
> <VirtualHost foo>
>    PerlRequire foo.pl
> </VirtualHost>


probably need to add a new test.


> i think the following would be ok though.


+1, good catch!

 
> Index: src/modules/perl/mod_perl.c
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
> retrieving revision 1.104
> diff -u -r1.104 mod_perl.c
> --- src/modules/perl/mod_perl.c	9 Jan 2002 00:31:39 -0000	1.104
> +++ src/modules/perl/mod_perl.c	16 Jan 2002 16:59:42 -0000
> @@ -264,14 +264,15 @@
>                         "created parent interpreter for VirtualHost %s\n",
>                         modperl_server_desc(s, p));
>          }
> -
> -        if (!modperl_config_apply_PerlModule(s, scfg, perl, p)) {
> -            exit(1);
> -        }
> -        if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
> -            exit(1);
> +        else {
> +            if (!modperl_config_apply_PerlModule(s, scfg, perl, p)) {
> +                exit(1);
> +            }
> +            if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
> +                exit(1);
> +            }
>          }
> -        
> +
>  #ifdef USE_ITHREADS
>  
>          if (!MpSrvENABLE(scfg)) {
> 



-- 


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] removing redundant perlmodule/perlrequire calls

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 16 Jan 2002, Stas Bekman wrote:

> I think we don't need these calls, they are already called from 
> modperl_startup() for vhosts that need their own parent perl interpreter.

that would mean Perl{Require,Module} would not be applied in a vhost that
shares the parent interpreter.  for example, this would be ignored:

<VirtualHost foo>
   PerlRequire foo.pl
</VirtualHost>

i think the following would be ok though.

Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.104
diff -u -r1.104 mod_perl.c
--- src/modules/perl/mod_perl.c	9 Jan 2002 00:31:39 -0000	1.104
+++ src/modules/perl/mod_perl.c	16 Jan 2002 16:59:42 -0000
@@ -264,14 +264,15 @@
                        "created parent interpreter for VirtualHost %s\n",
                        modperl_server_desc(s, p));
         }
-
-        if (!modperl_config_apply_PerlModule(s, scfg, perl, p)) {
-            exit(1);
-        }
-        if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
-            exit(1);
+        else {
+            if (!modperl_config_apply_PerlModule(s, scfg, perl, p)) {
+                exit(1);
+            }
+            if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
+                exit(1);
+            }
         }
-        
+
 #ifdef USE_ITHREADS
 
         if (!MpSrvENABLE(scfg)) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org