perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgollu...@apache.org
Subject svn commit: r419497 - in /perl/modperl/trunk: Changes lib/ModPerl/Code.pm src/modules/perl/modperl_config.c src/modules/perl/modperl_options.c t/response/TestModperl/perl_options2.pm
Date Thu, 06 Jul 2006 09:23:25 GMT
Author: pgollucci
Date: Thu Jul  6 02:23:24 2006
New Revision: 419497

URL: http://svn.apache.org/viewvc?rev=419497&view=rev
Log:
PerlOptions None was being reported as 
  "Invalid per-directory PerlOption: None"
or
  "Invalid per-server PerlOption: None" 
inccorectly do to a return value conflict with the #define value 
for MpDir_f_NONE.

Reported by: anders@kaseorg.com



Added:
    perl/modperl/trunk/t/response/TestModperl/perl_options2.pm
Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/lib/ModPerl/Code.pm
    perl/modperl/trunk/src/modules/perl/modperl_config.c
    perl/modperl/trunk/src/modules/perl/modperl_options.c

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=419497&r1=419496&r2=419497&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Thu Jul  6 02:23:24 2006
@@ -12,6 +12,10 @@
 
 =item 2.0.3-dev
 
+PerlOptions None was previously incorrectly reported as invalid
+inside <VirtualHost> or <Directory> blocks.
+[Philip M. Gollucci]
+
 Require B::Size 0.07 and B::TerseSize 0.07 for Apache2::Status
 [Philip M. Gollucci]
 

Modified: perl/modperl/trunk/lib/ModPerl/Code.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/Code.pm?rev=419497&r1=419496&r2=419497&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/Code.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/Code.pm Thu Jul  6 02:23:24 2006
@@ -460,7 +460,7 @@
                 push @lookup, $indent1 . "  case '$_':";
                 push @lookup, map { $indent2 . $_ } @{ $switch{$_} };
             }
-            push @lookup, map { $indent1 . $_ } ("}\n", "return 0;\n}\n\n");
+            push @lookup, map { $indent1 . $_ } ("}\n", "return -1;\n}\n\n");
 
             print $c_fh join "\n", @lookup;
             print $h_fh "$lookup_proto;\n";

Modified: perl/modperl/trunk/src/modules/perl/modperl_config.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_config.c?rev=419497&r1=419496&r2=419497&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_config.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_config.c Thu Jul  6 02:23:24 2006
@@ -646,7 +646,7 @@
     /*  }                         */
 
     if (r) {
-        if ((flag = modperl_flags_lookup_dir(name))) {
+        if ((flag = modperl_flags_lookup_dir(name)) != -1) {
             MP_dDCFG;
             return MpDirFLAGS(dcfg) & flag ? 1 : 0;
         }
@@ -655,7 +655,7 @@
         }
     }
     else {
-        if ((flag = modperl_flags_lookup_srv(name))) {
+        if ((flag = modperl_flags_lookup_srv(name)) != -1) {
             return MpSrvFLAGS(scfg) & flag ? 1 : 0;
         }
         else {

Modified: perl/modperl/trunk/src/modules/perl/modperl_options.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_options.c?rev=419497&r1=419496&r2=419497&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_options.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_options.c Thu Jul  6 02:23:24 2006
@@ -71,7 +71,7 @@
         action = *(str++);
     }
 
-    if (!(opt = flags_lookup(o, str))) {
+    if ((opt = flags_lookup(o, str)) == -1) {
         error = apr_pstrcat(p, "Invalid per-", type_lookup(o),
                             " PerlOption: ", str, NULL);
 
@@ -79,7 +79,7 @@
             modperl_options_t dummy;
             MpOptionsTypeSrv_set(&dummy);
 
-            if (flags_lookup(&dummy, str)) {
+            if (flags_lookup(&dummy, str) != -1) {
                 error = apr_pstrcat(p, error,
                                     " (only allowed per-server)",
                                     NULL);

Added: perl/modperl/trunk/t/response/TestModperl/perl_options2.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestModperl/perl_options2.pm?rev=419497&view=auto
==============================================================================
--- perl/modperl/trunk/t/response/TestModperl/perl_options2.pm (added)
+++ perl/modperl/trunk/t/response/TestModperl/perl_options2.pm Thu Jul  6 02:23:24 2006
@@ -0,0 +1,21 @@
+package TestModperl::perl_options2;
+
+# test whether PerlOptions None works in VirtualHost and Directory
+
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestUtil;
+
+1;
+__DATA__
+<NoAutoConfig>
+<VirtualHost TestModperl::perl_options2>
+    PerlOptions None
+    <Directory />
+        PerlOptions None
+    </Directory>
+</VirtualHost>
+</NoAutoConfig>
+



Mime
View raw message