perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steve...@apache.org
Subject svn commit: r1602099 - in /perl/modperl/trunk: ./ lib/Apache2/ lib/ModPerl/ src/modules/perl/ t/api/ t/hooks/TestHooks/ t/preconnection/TestPreConnection/ t/response/TestAPI/ t/response/TestAPR/ t/response/TestDirective/ t/response/TestModperl/ xs/APR/...
Date Thu, 12 Jun 2014 09:11:40 GMT
Author: stevehay
Date: Thu Jun 12 09:11:39 2014
New Revision: 1602099

URL: http://svn.apache.org/r1602099
Log:
[Auto-merge of all httpd24 revisions back into trunk]

Merged revision(s)  from perl/modperl/branches/httpd24:

Added:
    perl/modperl/trunk/t/api/access2_24.t
      - copied unchanged from r1602098, perl/modperl/branches/httpd24/t/api/access2_24.t
    perl/modperl/trunk/t/response/TestAPI/access2_24.pm
      - copied unchanged from r1602098, perl/modperl/branches/httpd24/t/response/TestAPI/access2_24.pm
    perl/modperl/trunk/xs/APR/aprext/modperl_dummy.c
      - copied unchanged from r1602098, perl/modperl/branches/httpd24/xs/APR/aprext/modperl_dummy.c
    perl/modperl/trunk/xs/Apache2/ServerRec/Apache2__ServerRec.h
      - copied unchanged from r1602098, perl/modperl/branches/httpd24/xs/Apache2/ServerRec/Apache2__ServerRec.h
    perl/modperl/trunk/xs/tables/current24/
      - copied from r1602098, perl/modperl/branches/httpd24/xs/tables/current24/
Modified:
    perl/modperl/trunk/   (props changed)
    perl/modperl/trunk/Makefile.PL
    perl/modperl/trunk/lib/Apache2/Build.pm
    perl/modperl/trunk/lib/Apache2/ParseSource.pm
    perl/modperl/trunk/lib/ModPerl/BuildOptions.pm
    perl/modperl/trunk/lib/ModPerl/CScan.pm
    perl/modperl/trunk/lib/ModPerl/Code.pm
    perl/modperl/trunk/lib/ModPerl/MapUtil.pm
    perl/modperl/trunk/src/modules/perl/mod_perl.c
    perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c
    perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h
    perl/modperl/trunk/src/modules/perl/modperl_apache_includes.h
    perl/modperl/trunk/src/modules/perl/modperl_cmd.c
    perl/modperl/trunk/src/modules/perl/modperl_cmd.h
    perl/modperl/trunk/src/modules/perl/modperl_interp.c
    perl/modperl/trunk/src/modules/perl/modperl_util.c
    perl/modperl/trunk/src/modules/perl/modperl_util.h
    perl/modperl/trunk/t/api/access2.t
    perl/modperl/trunk/t/hooks/TestHooks/authen_basic.pm
    perl/modperl/trunk/t/hooks/TestHooks/authen_digest.pm
    perl/modperl/trunk/t/hooks/TestHooks/authz.pm
    perl/modperl/trunk/t/hooks/TestHooks/stacked_handlers2.pm
    perl/modperl/trunk/t/preconnection/TestPreConnection/note.pm
    perl/modperl/trunk/t/response/TestAPI/access2.pm
    perl/modperl/trunk/t/response/TestAPI/add_config.pm
    perl/modperl/trunk/t/response/TestAPI/aplog.pm
    perl/modperl/trunk/t/response/TestAPI/conn_rec.pm
    perl/modperl/trunk/t/response/TestAPI/request_util.pm
    perl/modperl/trunk/t/response/TestAPR/ipsubnet.pm
    perl/modperl/trunk/t/response/TestAPR/sockaddr.pm
    perl/modperl/trunk/t/response/TestDirective/cmdparms.pm
    perl/modperl/trunk/t/response/TestModperl/setauth.pm
    perl/modperl/trunk/xs/APR/APR/Makefile.PL
    perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
    perl/modperl/trunk/xs/APR/aprext/Makefile.PL
    perl/modperl/trunk/xs/Apache2/Access/Apache2__Access.h
    perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h
    perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
    perl/modperl/trunk/xs/ModPerl/Const/Const.xs
    perl/modperl/trunk/xs/maps/apache2_functions.map
    perl/modperl/trunk/xs/maps/apache2_structures.map
    perl/modperl/trunk/xs/maps/modperl_functions.map
    perl/modperl/trunk/xs/maps/modperl_types.map
    perl/modperl/trunk/xs/tables/current/Apache2/ConstantsTable.pm

Propchange: perl/modperl/trunk/
------------------------------------------------------------------------------
--- svn:externals (original)
+++ svn:externals Thu Jun 12 09:11:39 2014
@@ -1,4 +1,4 @@
-Apache-Test https://svn.apache.org/repos/asf/perl/Apache-Test/tags/1_37
+Apache-Test -r 1504090 https://svn.apache.org/repos/asf/perl/Apache-Test/trunk
 Apache-Reload https://svn.apache.org/repos/asf/perl/Apache-Reload/tags/0_12
 Apache-SizeLimit https://svn.apache.org/repos/asf/perl/Apache-SizeLimit/tags/0_97
 docs        https://svn.apache.org/repos/asf/perl/modperl/docs/trunk/src/docs/2.0

Propchange: perl/modperl/trunk/
------------------------------------------------------------------------------
    svn:mergeinfo = /perl/modperl/branches/httpd24:1151159-1602098

Propchange: perl/modperl/trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun 12 09:11:39 2014
@@ -1 +1 @@
-/perl/modperl/branches/httpd24:1-1151159 /perl/modperl/branches/threading:1-584361
+/perl/modperl/branches/threading:1-584361 /perl/modperl/trunk:1-1496003

Modified: perl/modperl/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Makefile.PL?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/Makefile.PL (original)
+++ perl/modperl/trunk/Makefile.PL Thu Jun 12 09:11:39 2014
@@ -8,6 +8,7 @@ $ENV{MOD_PERL_2_BUILD} = 1;
 
 use constant MIN_HTTPD_VERSION_DYNAMIC => '2.0.47';
 use constant MIN_HTTPD_VERSION_STATIC  => '2.0.51';
+use constant MIN_HTTPD_24_VERSION => '2.4.0';
 
 my($old_modperl_version, $old_modperl_pm, $old_Apache2_pm);
 
@@ -412,9 +413,13 @@ sub post_configure {
 sub tables_dir {
     my $httpd_version = shift;
 
-    my $tables_version = 'current';
-    #XXX: support versioning
-    #$httpd_version =~ /-dev$/ ? 'current' : $httpd_version;
+    my $tables_version='';
+    if ($httpd_version lt MIN_HTTPD_24_VERSION) {
+        $tables_version='current';
+    }
+    else {
+        $tables_version='current24';
+    }
 
     my $tables_dir = "xs/tables/$tables_version";
 }
@@ -770,8 +775,24 @@ sub MY::test {
             $ap_bindir = File::Spec->catdir($build->{MP_AP_PREFIX}, 'bin')
                 if $build->{MP_AP_PREFIX};
         }
+        my $modperl_libexecdir = '';
+        if ($build->is_dynamic) {
+            # need to add the location of mod_perl.so to the PATH
+            my $lib = $build->modperl_libpath() || '';
+            if ($lib) {
+                $modperl_libexecdir = File::Basename::dirname($lib);
+            }
+            else {
+                $modperl_libexecdir = File::Spec->catdir($build->{cwd},
+                                                         'src/modules/perl')
+                    if $build->{cwd};
+            }
+        }
+        my $extra_path = '';
+        $extra_path .= ";$ap_bindir" if $ap_bindir;
+        $extra_path .= ";$modperl_libexecdir" if $modperl_libexecdir;
         $preamble = <<EOF;
-PATH = \$(PATH);$ap_bindir
+PATH = \$(PATH)$extra_path
 EOF
     }
     else {

Modified: perl/modperl/trunk/lib/Apache2/Build.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/Apache2/Build.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/lib/Apache2/Build.pm (original)
+++ perl/modperl/trunk/lib/Apache2/Build.pm Thu Jun 12 09:11:39 2014
@@ -282,7 +282,7 @@ my %threaded_mpms = map { $_ => 1 }
 sub mpm_is_threaded {
     my $self = shift;
     my $mpm_name = $self->mpm_name();
-    return $threaded_mpms{$mpm_name} || 0;
+    return exists $threaded_mpms{$mpm_name} ? 1 : 0;
 }
 
 sub mpm_name {
@@ -290,6 +290,11 @@ sub mpm_name {
 
     return $self->{mpm_name} if $self->{mpm_name};
 
+    if ($self->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/) {
+	delete $threaded_mpms{dynamic} if $self->mp_nonthreaded_ok;
+	return $self->{mpm_name} = 'dynamic' if ($1*1000+$2)*1000+$3>=2003000;
+    }
+
     # XXX: hopefully apxs will work on win32 one day
     return $self->{mpm_name} = 'winnt' if WIN32;
 
@@ -1154,18 +1159,7 @@ sub apr_bindir {
 
 sub apr_generation {
     my ($self) = @_;
-
-    my $httpd_v = $self->httpd_version_as_int;
-
-    if ($httpd_v =~ m/2[4-9]\d+/) {
-        return 2;
-    }
-    elsif ($httpd_v =~ m/2[1-3]\d+/) {
-        return 1;
-    }
-    else {
-        return;
-    }
+    return $self->httpd_version_as_int =~ m/2[1-9]\d+/ ? 1 : 0;
 }
 
 # returns an array of apr/apu linking flags (--link-ld --libs) if found
@@ -1225,8 +1219,7 @@ sub apru_config_path {
         $self->{$key} = $self->{$mp_key};
     }
 
-    my $apr_generation = $self->apr_generation;
-    my $config = $apr_generation ? "$what-${apr_generation}-config" : "$what-config";
+    my $config = $self->apr_generation ? "$what-1-config" : "$what-config";
 
     if (!$self->{$key}) {
         my @tries = ();
@@ -2213,7 +2206,8 @@ sub has_large_files_conflict {
     # with it is that we didn't have such a case yet, but may need to
     # deal with it later
 
-    return $perl_lfs64 ^ $apr_lfs64;
+    return 0;
+    # $perl_lfs64 ^ $apr_lfs64;
 }
 
 # if perl is built with uselargefiles, but apr not, the build won't

Modified: perl/modperl/trunk/lib/Apache2/ParseSource.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/Apache2/ParseSource.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/lib/Apache2/ParseSource.pm (original)
+++ perl/modperl/trunk/lib/Apache2/ParseSource.pm Thu Jun 12 09:11:39 2014
@@ -73,6 +73,9 @@ my @c_scan_defines = (
     'CORE_PRIVATE',   #so we get all of apache
     'MP_SOURCE_SCAN', #so we can avoid some c-scan barfing
     '_NETINET_TCP_H', #c-scan chokes on netinet/tcp.h
+    '_BYTESWAP_H', #c-scan chokes on byteswap.h
+    '_BITS_BYTESWAP_H', #c-scan chokes on byteswap.h
+    'Expat_INCLUDED', #c-scan chokes on expath.h
  #   'APR_OPTIONAL_H', #c-scan chokes on apr_optional.h
     'apr_table_do_callback_fn_t=void', #c-scan chokes on function pointers
 );
@@ -252,6 +255,7 @@ my %defines_wanted = (
         remotehost => [qw{REMOTE_}],
         satisfy    => [qw{SATISFY_}],
         types      => [qw{DIR_MAGIC_TYPE}],
+        auth       => [qw{AUTHN_ AUTHZ AP_AUTH_ AUTH_ AUTHZ_}],
     },
     'APR::Const' => {
         common    => [qw{APR_SUCCESS}],
@@ -284,7 +288,7 @@ while (my ($class, $groups) = each %defi
 }
 
 my %enums_wanted = (
-    'Apache2::Const' => { map { $_, 1 } qw(cmd_how input_mode filter_type conn_keepalive) },
+    'Apache2::Const' => { map { $_, 1 } qw(cmd_how input_mode filter_type conn_keepalive authn_status authz_status) },
     'APR::Const' => { map { $_, 1 } qw(apr_shutdown_how apr_read_type apr_lockmech) },
 );
 
@@ -411,6 +415,8 @@ sub get_functions {
     my $c = $self->{c};
 
     my $fdecls = $c->get($key);
+    my $inlines = $c->get('parsed_inlines');
+    push @{$fdecls}, @{$inlines};
 
     my %seen;
     my $wanted = $self->wanted_functions;
@@ -533,7 +539,16 @@ sub write_pm {
 
     my ($subdir) = (split '::', $name)[0];
 
-    my $tdir = 'xs/tables/current';
+    my $tdir = '';
+    my $build = Apache2::Build->new(init => 1);
+    my $httpd_version = $build->httpd_version;
+    if ($httpd_version lt '2.4.0') {
+        $tdir='xs/tables/current';
+    }
+    else {
+        $tdir='xs/tables/current24';
+    }
+
     if (-d "$tdir/$subdir") {
         $file = "$tdir/$subdir/$file";
     }

Modified: perl/modperl/trunk/lib/ModPerl/BuildOptions.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/BuildOptions.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/BuildOptions.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/BuildOptions.pm Thu Jun 12 09:11:39 2014
@@ -264,4 +264,4 @@ GENERATE_XS    0    Generate XS code bas
 LIBNAME        0    Name of the modperl dso library (default is  mod_perl)
 COMPAT_1X      0    Compile-time mod_perl 1.0 backcompat (default is  on)
 APR_LIB        0    Lib used to build APR::* on Win32 (default is aprext)
-
+NONTHREADED_OK 0    Using a non-threaded perl is okay with httpd >=2.3

Modified: perl/modperl/trunk/lib/ModPerl/CScan.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/CScan.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/CScan.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/CScan.pm Thu Jun 12 09:11:39 2014
@@ -136,6 +136,8 @@ my $recipes
       vdecl_hash => { filter => [ \&vdecl_hash, 'vdecls', 'mdecls' ], },
       parsed_fdecls => { filter => [ \&do_declarations, 'fdecls',
                                      'typedef_hash', 'keywords'], },
+      parsed_inlines => { filter => [ \&do_declarations, 'inlines',
+                                     'typedef_hash', 'keywords'], },
       keywords_rex => { filter => [ sub { my @k = keys %{ shift() };
                                           local $" = '|';
                                           my $r = "(?:@k)";

Modified: perl/modperl/trunk/lib/ModPerl/Code.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/Code.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/Code.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/Code.pm Thu Jun 12 09:11:39 2014
@@ -891,6 +891,15 @@ EOF
             if ($name eq 'DECLINE_CMD' ||
                 $name eq 'DIR_MAGIC_TYPE' ||
                 $name eq 'CRLF' ||
+                $name eq 'AUTHN_PROVIDER_GROUP' ||
+                $name eq 'AUTHZ_PROVIDER_GROUP' ||
+                $name eq 'AUTHN_PROVIDER_VERSION' ||
+                $name eq 'AUTHZ_PROVIDER_VERSION' ||
+                $name eq 'AUTHN_DEFAULT_PROVIDER' ||
+                $name eq 'AUTHN_PROVIDER_NAME_NOTE' ||
+                $name eq 'AUTHZ_PROVIDER_NAME_NOTE' ||
+                $name eq 'AUTHN_PREFIX' ||
+                $name eq 'AUTHZ_PREFIX' ||
                 $name eq 'CRLF_ASCII') {
                 print $c_fh <<EOF;
               return newSVpv($alias{$name}, 0);

Modified: perl/modperl/trunk/lib/ModPerl/MapUtil.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/MapUtil.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/MapUtil.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/MapUtil.pm Thu Jun 12 09:11:39 2014
@@ -46,7 +46,14 @@ my $function_table = [];
 
 sub function_table {
     return $function_table if @$function_table;
-    push @INC, "xs/tables/current";
+    my $build = Apache2::Build->new(init => 1);
+    my $httpd_version = $build->httpd_version;
+    if ($httpd_version lt '2.4.0' || ! -d "xs/tables/current24") {
+        push @INC, "xs/tables/current";
+    }
+    else {
+        push @INC, "xs/tables/current24";
+    }
     require Apache2::FunctionTable;
     require ModPerl::FunctionTable;
     require APR::FunctionTable;
@@ -103,15 +110,28 @@ sub readline {
         # #_end_
         if (/^\s*#\s*_(if|unless|els(?:e|if)|end)_(?:\s(.+))?/) {
             my ($cmd, $param) = ($1, $2);
+            if (defined $param) {
+                while ($param=~s!\\$!!) {
+                    my $l=<$fh>;
+                    die "$ModPerl::MapUtil::MapFile($.): unexpected EOF\n"
+                        unless defined $l;
+                    chomp $l;
+                    $param.=$l;
+                }
+            }
             if ($cmd eq 'if') {
-                unshift @condition, 0+!!eval $param;
+                unshift @condition,
+                    0+!!eval "#line $. $ModPerl::MapUtil::MapFile\n".$param;
+                die $@ if $@;
             }
             elsif ($cmd eq 'elsif') {
                 die "parse error ($ModPerl::MapUtil::MapFile line $.)".
                     " #_elsif_ without #_if_"
                     unless @condition;
                 if ($condition[0] == 0) {
-                    $condition[0]+=!!eval $param;
+                    $condition[0]+=
+                        !!eval "#line $. $ModPerl::MapUtil::MapFile\n".$param;
+                    die $@ if $@;
                 } else {
                     $condition[0]++;
                 }
@@ -123,7 +143,9 @@ sub readline {
                 $condition[0]+=1;
             }
             elsif ($cmd eq 'unless') {
-                unshift @condition, 0+!eval $param;
+                unshift @condition,
+                    0+!eval "#line $. $ModPerl::MapUtil::MapFile\n".$param;
+                die $@ if $@;
             }
             elsif ($cmd eq 'end') {
                 shift @condition;
@@ -133,6 +155,15 @@ sub readline {
 
         if (/^\s*#\s*_(eval)_(?:\s(.+))?/) {
             my ($cmd, $param) = ($1, $2);
+            if (defined $param) {
+                while ($param=~s!\\$!!) {
+                    my $l=<$fh>;
+                    die "$ModPerl::MapUtil::MapFile($.): unexpected EOF\n"
+                        unless defined $l;
+                    chomp $l;
+                    $param.=$l;
+                }
+            }
             if ($cmd eq 'eval') {
                 eval "#line $. $ModPerl::MapUtil::MapFile\n".$param;
                 die $@ if $@;

Modified: perl/modperl/trunk/src/modules/perl/mod_perl.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/mod_perl.c?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/mod_perl.c (original)
+++ perl/modperl/trunk/src/modules/perl/mod_perl.c Thu Jun 12 09:11:39 2014
@@ -653,6 +653,10 @@ int modperl_is_running(void)
 int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog,
                             apr_pool_t *ptemp)
 {
+#if AP_MODULE_MAGIC_AT_LEAST(20110329,0)
+    ap_reserve_module_slots_directive("PerlLoadModule");
+#endif
+
     /* we can't have PerlPreConfigHandler without first configuring mod_perl */
 
     /* perl 5.8.1+ */
@@ -907,6 +911,11 @@ static const command_rec modperl_cmds[] 
     MP_CMD_DIR_ITERATE("PerlRequire", requires, "PerlRequire"),
     MP_CMD_SRV_ITERATE("PerlConfigRequire", config_requires, "PerlConfigRequire"),
     MP_CMD_SRV_ITERATE("PerlPostConfigRequire", post_config_requires, "PerlPostConfigRequire"),
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+    MP_CMD_SRV_TAKE2("PerlAddAuthzProvider", authz_provider, "PerlAddAuthzProvider"),
+    MP_CMD_SRV_TAKE2("PerlAddAuthnProvider", authn_provider, "PerlAddAuthnProvider"),
+#endif
     MP_CMD_DIR_ITERATE("PerlOptions", options, "Perl Options"),
     MP_CMD_DIR_ITERATE("PerlInitHandler", init_handlers, "Subroutine name"),
     MP_CMD_DIR_TAKE2("PerlSetVar", set_var, "PerlSetVar"),

Modified: perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c Thu Jun 12 09:11:39 2014
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#define AP_DECLARE_EXPORT
 #include "mod_perl.h"
 
 /* back compat adjustements for older Apache versions

Modified: perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h Thu Jun 12 09:11:39 2014
@@ -66,9 +66,9 @@ AP_DECLARE(const char *) ap_get_server_v
 #define MP_HTTPD_OVERRIDE_HTACCESS (OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
 
 #define MP_HTTPD_OVERRIDE_OPTS_UNSET (-1)
-
 #if AP_SERVER_MAJORVERSION_NUMBER>2 || \
     (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+
 /* 2.4 API */
 #define MP_HTTPD_OVERRIDE_OPTS_DEFAULT (OPT_UNSET | \
                                         OPT_ALL | \
@@ -95,7 +95,7 @@ AP_DECLARE(const char *) ap_get_server_v
 
 #define ap_unixd_config unixd_config
 
-#endif
+#endif /* 2.4 vs. 2.2 API */
 
 #ifndef PROXYREQ_RESPONSE
 #define PROXYREQ_RESPONSE (3)

Modified: perl/modperl/trunk/src/modules/perl/modperl_apache_includes.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_apache_includes.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_apache_includes.h (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_apache_includes.h Thu Jun 12 09:11:39 2014
@@ -43,4 +43,10 @@
 APLOG_USE_MODULE(perl);
 #endif
 
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+#include "ap_provider.h"
+#include "mod_auth.h"
+#endif
+
 #endif /* MODPERL_APACHE_INCLUDES_H */

Modified: perl/modperl/trunk/src/modules/perl/modperl_cmd.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_cmd.c?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_cmd.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_cmd.c Thu Jun 12 09:11:39 2014
@@ -417,6 +417,35 @@ MP_CMD_SRV_DECLARE(init_handlers)
     return modperl_cmd_post_read_request_handlers(parms, mconfig, arg);
 }
 
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+
+MP_CMD_SRV_DECLARE2(authz_provider)
+{
+    apr_pool_t *p = parms->pool;
+    char *name = apr_pstrdup(p, arg1);
+    char *cb = apr_pstrdup(p, arg2);
+
+    modperl_register_auth_provider_name(p, AUTHZ_PROVIDER_GROUP, name,
+                                        AUTHZ_PROVIDER_VERSION, cb, NULL,
+                                        AP_AUTH_INTERNAL_PER_CONF);
+    return NULL;
+}
+
+MP_CMD_SRV_DECLARE2(authn_provider)
+{
+    apr_pool_t *p = parms->pool;
+    char *name = apr_pstrdup(p, arg1);
+    char *cb = apr_pstrdup(p, arg2);
+
+    modperl_register_auth_provider_name(p, AUTHN_PROVIDER_GROUP, name,
+                                        AUTHN_PROVIDER_VERSION, cb, NULL,
+                                        AP_AUTH_INTERNAL_PER_CONF);
+    return NULL;
+}
+
+#endif
+
 static const char *modperl_cmd_parse_args(apr_pool_t *p,
                                           const char *args,
                                           apr_table_t **t)

Modified: perl/modperl/trunk/src/modules/perl/modperl_cmd.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_cmd.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_cmd.h (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_cmd.h Thu Jun 12 09:11:39 2014
@@ -42,6 +42,11 @@ MP_CMD_SRV_DECLARE(modules);
 MP_CMD_SRV_DECLARE(requires);
 MP_CMD_SRV_DECLARE(config_requires);
 MP_CMD_SRV_DECLARE(post_config_requires);
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+MP_CMD_SRV_DECLARE2(authz_provider);
+MP_CMD_SRV_DECLARE2(authn_provider);
+#endif
 MP_CMD_SRV_DECLARE2(set_var);
 MP_CMD_SRV_DECLARE2(add_var);
 MP_CMD_SRV_DECLARE2(set_env);
@@ -115,6 +120,10 @@ MP_CMD_SRV_DECLARE(interp_scope);
    AP_INIT_ITERATE( name, modperl_cmd_##item, NULL, \
       RSRC_CONF, desc )
 
+#define MP_CMD_SRV_ITERATE_ON_READ(name, item, desc) \
+   AP_INIT_ITERATE( name, modperl_cmd_##item, NULL, \
+      RSRC_CONF|EXEC_ON_READ, desc )
+
 #define MP_CMD_SRV_ITERATE2(name, item, desc) \
    AP_INIT_ITERATE2( name, modperl_cmd_##item, NULL, \
       RSRC_CONF, desc )

Modified: perl/modperl/trunk/src/modules/perl/modperl_interp.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_interp.c?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_interp.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_interp.c Thu Jun 12 09:11:39 2014
@@ -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/trunk/src/modules/perl/modperl_util.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_util.c?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_util.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_util.c Thu Jun 12 09:11:39 2014
@@ -910,3 +910,319 @@ U16 *modperl_code_attrs(pTHX_ CV *cv) {
     mg = mg_find((SV*)cv, PERL_MAGIC_ext);
     return &(mg->mg_private);
 }
+
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+
+static apr_hash_t *global_authz_providers = NULL;
+static apr_hash_t *global_authn_providers = NULL;
+
+typedef struct {
+    SV *cb1;
+    SV *cb2;
+    modperl_handler_t *cb1_handler;
+    modperl_handler_t *cb2_handler;
+} auth_callback;
+
+static apr_status_t cleanup_perl_global_providers(void *ctx)
+{
+    global_authz_providers = NULL;
+    global_authn_providers = NULL;
+    return APR_SUCCESS;
+}
+
+static authz_status perl_check_authorization(request_rec *r,
+                                             const char *require_args,
+                                             const void *parsed_require_args)
+{
+    authz_status ret = AUTHZ_DENIED;
+    int count;
+    AV *args = Nullav;
+    const char *key;
+    auth_callback *ab;
+    MP_dTHX;
+    dSP;
+
+    if (global_authz_providers == NULL) {
+        return ret;
+    }
+
+    key = apr_table_get(r->notes, AUTHZ_PROVIDER_NAME_NOTE);
+    ab = apr_hash_get(global_authz_providers, key, APR_HASH_KEY_STRING);
+    if (ab == NULL) {
+        return ret;
+    }
+
+    if (ab->cb1 == NULL) {
+        if (ab->cb1_handler == NULL) {
+            return ret;
+        }
+
+        modperl_handler_make_args(aTHX_ &args, "Apache2::RequestRec", r,
+                                  "PV", require_args, NULL);
+        ret = modperl_callback(aTHX_ ab->cb1_handler, r->pool, r, r->server,
+                               args);
+        SvREFCNT_dec((SV*)args);
+        return ret;
+    }
+
+    ENTER;
+    SAVETMPS;
+    PUSHMARK(SP);
+    XPUSHs(sv_2mortal(modperl_ptr2obj(aTHX_ "Apache2::RequestRec", r)));
+    XPUSHs(sv_2mortal(newSVpv(require_args, 0)));
+    PUTBACK;
+    count = call_sv(ab->cb1, G_SCALAR);
+    SPAGAIN;
+
+    if (count == 1) {
+        ret = (authz_status) POPi;
+    }
+
+    PUTBACK;
+    FREETMPS;
+    LEAVE;
+    return ret;
+}
+
+static const char *perl_parse_require_line(cmd_parms *cmd,
+                                           const char *require_line,
+                                           const void **parsed_require_line)
+{
+    SV *ret_sv;
+    char *ret = NULL;
+    int count;
+    void *key;
+    auth_callback *ab;
+    modperl_interp_t *interp;
+
+    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;
+    }
+
+#ifdef USE_ITHREADS
+    interp = modperl_interp_pool_select(cmd->server->process->pool, cmd->server);
+    if (interp) {
+        dTHXa(interp->perl);
+#else
+    {
+#endif
+        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;
+
+        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;
+    }
+    return ret;
+}
+
+static authn_status perl_check_password(request_rec *r, const char *user,
+                                        const char *password)
+{
+    authn_status ret = AUTH_DENIED;
+    int count;
+    AV *args = Nullav;
+    const char *key;
+    auth_callback *ab;
+    MP_dTHX;
+    dSP;
+
+    if (global_authn_providers == NULL) {
+        return ret;
+    }
+
+    key = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
+    ab = apr_hash_get(global_authn_providers, key,
+                                     APR_HASH_KEY_STRING);
+    if (ab == NULL || ab->cb1) {
+        return ret;
+    }
+
+    if (ab->cb1 == NULL) {
+        if (ab->cb1_handler == NULL) {
+            return ret;
+        }
+
+        modperl_handler_make_args(aTHX_ &args, "Apache2::RequestRec", r,
+                                  "PV", user,
+                                  "PV", password, NULL);
+        ret = modperl_callback(aTHX_ ab->cb1_handler, r->pool, r, r->server,
+                               args);
+        SvREFCNT_dec((SV*)args);
+        return ret;
+    }
+
+    ENTER;
+    SAVETMPS;
+    PUSHMARK(SP);
+    XPUSHs(sv_2mortal(modperl_ptr2obj(aTHX_ "Apache2::RequestRec", r)));
+    XPUSHs(sv_2mortal(newSVpv(user, 0)));
+    XPUSHs(sv_2mortal(newSVpv(password, 0)));
+    PUTBACK;
+    count = call_sv(ab->cb1, G_SCALAR);
+    SPAGAIN;
+
+    if (count == 1) {
+        ret = (authn_status) POPi;
+    }
+
+    PUTBACK;
+    FREETMPS;
+    LEAVE;
+    return ret;
+}
+
+static authn_status perl_get_realm_hash(request_rec *r, const char *user,
+                                        const char *realm, char **rethash)
+{
+    authn_status ret = AUTH_USER_NOT_FOUND;
+    int count;
+    SV *rh;
+    const char *key;
+    auth_callback *ab;
+    MP_dTHX;
+    dSP;
+
+    if (global_authn_providers == NULL) {
+        return ret;
+    }
+
+    key = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE);
+    ab = apr_hash_get(global_authn_providers, key, APR_HASH_KEY_STRING);
+    if (ab == NULL || ab->cb2) {
+        return ret;
+    }
+
+    rh = sv_2mortal(newSVpv("", 0));
+    ENTER;
+    SAVETMPS;
+    PUSHMARK(SP);
+    XPUSHs(sv_2mortal(modperl_ptr2obj(aTHX_ "Apache2::RequestRec", r)));
+    XPUSHs(sv_2mortal(newSVpv(user, 0)));
+    XPUSHs(sv_2mortal(newSVpv(realm, 0)));
+    XPUSHs(newRV_noinc(rh));
+    PUTBACK;
+    count = call_sv(ab->cb2, G_SCALAR);
+    SPAGAIN;
+
+    if (count == 1) {
+        const char *tmp = SvPV_nolen(rh);
+        ret = (authn_status) POPi;
+        if (*tmp != '\0') {
+            *rethash = apr_pstrdup(r->pool, tmp);
+        }
+    }
+
+    PUTBACK;
+    FREETMPS;
+    LEAVE;
+    return ret;
+}
+
+static const authz_provider authz_perl_provider = { perl_check_authorization,
+                                                    perl_parse_require_line };
+
+static const authn_provider authn_perl_provider = { perl_check_password,
+                                                    perl_get_realm_hash };
+
+static apr_status_t register_auth_provider(apr_pool_t *pool,
+                                           const char *provider_group,
+                                           const char *provider_name,
+                                           const char *provider_version,
+                                           auth_callback *ab, int type)
+{
+    void *provider_ = NULL;
+
+    if (global_authz_providers == NULL) {
+        global_authz_providers = apr_hash_make(pool);
+        global_authn_providers = apr_hash_make(pool);
+        /* We have to use pre_cleanup here, otherwise this cleanup method
+         * would be called after another cleanup method which unloads
+         * mod_perl module.
+         */
+        apr_pool_pre_cleanup_register(pool, NULL,
+                                      cleanup_perl_global_providers);
+    }
+
+    if (strcmp(provider_group, AUTHZ_PROVIDER_GROUP) == 0) {
+        provider_ = (void *) &authz_perl_provider;
+        apr_hash_set(global_authz_providers, provider_name,
+                     APR_HASH_KEY_STRING, ab);
+    }
+    else {
+        provider_ = (void *) &authn_perl_provider;
+        apr_hash_set(global_authn_providers, provider_name,
+                     APR_HASH_KEY_STRING, ab);
+    }
+
+    return ap_register_auth_provider(pool, provider_group, provider_name,
+                                     provider_version, provider_, type);
+
+}
+
+apr_status_t modperl_register_auth_provider(apr_pool_t *pool,
+                                            const char *provider_group,
+                                            const char *provider_name,
+                                            const char *provider_version,
+                                            SV *callback1, SV *callback2,
+                                            int type)
+{
+    char *provider_name_dup;
+    auth_callback *ab = NULL;
+
+    provider_name_dup = apr_pstrdup(pool, provider_name);
+    ab = apr_pcalloc(pool, sizeof(auth_callback));
+    ab->cb1 = callback1;
+    ab->cb2 = callback2;
+
+    return register_auth_provider(pool, provider_group, provider_name_dup,
+                                  provider_version, ab, type);
+}
+
+apr_status_t modperl_register_auth_provider_name(apr_pool_t *pool,
+                                                 const char *provider_group,
+                                                 const char *provider_name,
+                                                 const char *provider_version,
+                                                 const char *callback1,
+                                                 const char *callback2,
+                                                 int type)
+{
+    char *provider_name_dup;
+    auth_callback *ab = NULL;
+
+    provider_name_dup = apr_pstrdup(pool, provider_name);
+    ab = apr_pcalloc(pool, sizeof(auth_callback));
+    ab->cb1_handler = modperl_handler_new(pool, callback1);
+    if (callback2) {
+        ab->cb2_handler = modperl_handler_new(pool, callback2);
+    }
+
+    return register_auth_provider(pool, provider_group, provider_name_dup,
+                                  provider_version, ab, type);
+}
+
+#endif /* httpd-2.4 */

Modified: perl/modperl/trunk/src/modules/perl/modperl_util.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_util.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_util.h (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_util.h Thu Jun 12 09:11:39 2014
@@ -151,4 +151,21 @@ SV *modperl_pnotes(pTHX_ HV **pnotes, SV
 
 U16 *modperl_code_attrs(pTHX_ CV *cv);
 
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+apr_status_t
+modperl_register_auth_provider(apr_pool_t *pool, const char *provider_group,
+                               const char *provider_name,
+                               const char *provider_version, SV *callback1,
+                               SV *callback2, int type);
+
+apr_status_t
+modperl_register_auth_provider_name(apr_pool_t *pool,
+                                    const char *provider_group,
+                                    const char *provider_name,
+                                    const char *provider_version,
+                                    const char *callback1,
+                                    const char *callback2, int type);
+#endif
+
 #endif /* MODPERL_UTIL_H */

Modified: perl/modperl/trunk/t/api/access2.t
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/api/access2.t?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/api/access2.t (original)
+++ perl/modperl/trunk/t/api/access2.t Thu Jun 12 09:11:39 2014
@@ -5,6 +5,8 @@ use Apache::Test;
 use Apache::TestUtil;
 use Apache::TestRequest;
 
+if (!have_min_apache_version("2.4.0")) {
+
 plan tests => 6, need need_lwp, need_auth, need_access, 'HTML::HeadParser';
 
 my $location = "/TestAPI__access2";
@@ -27,4 +29,9 @@ ok GET_OK $location, username => 'goo', 
 ok POST_OK $location, username => 'bar', password => 'goopass1',
     content => "a";
 
+}
+else {
+
+plan tests => 1, need {"mod_perl is not compiled with httpd-2.2" => 0};
 
+}

Modified: perl/modperl/trunk/t/hooks/TestHooks/authen_basic.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/hooks/TestHooks/authen_basic.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/hooks/TestHooks/authen_basic.pm (original)
+++ perl/modperl/trunk/t/hooks/TestHooks/authen_basic.pm Thu Jun 12 09:11:39 2014
@@ -3,9 +3,13 @@ package TestHooks::authen_basic;
 use strict;
 use warnings FATAL => 'all';
 
+use Apache::Test;
+use Apache::TestUtil;
+
 use Apache2::Access ();
 
 use Apache2::Const -compile => qw(OK HTTP_UNAUTHORIZED SERVER_ERROR);
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 sub handler {
     my $r = shift;
@@ -16,9 +20,13 @@ sub handler {
 
     my $user = $r->user;
 
-    my $requirement = $r->requires->[0]->{requirement};
-
-    return Apache2::Const::SERVER_ERROR unless $requirement eq 'valid-user';
+    # We don't have to check for valid-user in 2.4.0+. If there is bug
+    # in require valid-user handling, it will result in failed test with
+    # bad username/password.
+    if (!APACHE24) {
+        my $requirement = $r->requires->[0]->{requirement};
+        return Apache2::Const::SERVER_ERROR unless $requirement eq 'valid-user';
+    }
 
     unless ($user eq 'dougm' and $sent_pw eq 'foo') {
         $r->note_basic_auth_failure;

Modified: perl/modperl/trunk/t/hooks/TestHooks/authen_digest.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/hooks/TestHooks/authen_digest.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/hooks/TestHooks/authen_digest.pm (original)
+++ perl/modperl/trunk/t/hooks/TestHooks/authen_digest.pm Thu Jun 12 09:11:39 2014
@@ -21,6 +21,9 @@ sub handler {
         return Apache2::Const::HTTP_UNAUTHORIZED;
     }
 
+    $r->user("user");
+    $r->ap_auth_type("Digest");
+
     return Apache2::Const::OK;
 }
 

Modified: perl/modperl/trunk/t/hooks/TestHooks/authz.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/hooks/TestHooks/authz.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/hooks/TestHooks/authz.pm (original)
+++ perl/modperl/trunk/t/hooks/TestHooks/authz.pm Thu Jun 12 09:11:39 2014
@@ -8,6 +8,7 @@ use Apache2::Access ();
 use Apache2::Const -compile => qw(OK HTTP_UNAUTHORIZED);
 
 sub auth_any {
+    my $self = shift;
     my $r = shift;
 
     my ($res, $sent_pw) = $r->get_basic_auth_pw;
@@ -30,9 +31,7 @@ sub handler {
 
     return Apache2::Const::HTTP_UNAUTHORIZED unless $user;
 
-    my ($u, @allowed) = split /\s+/, $r->requires->[0]->{requirement};
-
-    return Apache2::Const::HTTP_UNAUTHORIZED unless grep { $_ eq $user } @allowed;
+    return Apache2::Const::HTTP_UNAUTHORIZED unless "dougm" eq $user;
 
     Apache2::Const::OK;
 }
@@ -43,6 +42,6 @@ require user dougm
 AuthType Basic
 AuthName simple
 PerlModule          TestHooks::authz
-PerlAuthenHandler   TestHooks::authz::auth_any
+PerlAuthenHandler   TestHooks::authz->auth_any
 PerlResponseHandler Apache::TestHandler::ok1
 SetHandler modperl

Modified: perl/modperl/trunk/t/hooks/TestHooks/stacked_handlers2.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/hooks/TestHooks/stacked_handlers2.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/hooks/TestHooks/stacked_handlers2.pm (original)
+++ perl/modperl/trunk/t/hooks/TestHooks/stacked_handlers2.pm Thu Jun 12 09:11:39 2014
@@ -24,6 +24,17 @@ sub ok {
     return Apache2::Const::OK;
 }
 
+sub ok_authen {
+
+    my $r = shift;
+    callback($r);
+
+    $r->user("user");
+    $r->ap_auth_type("Basic");
+
+    return Apache2::Const::OK;
+}
+
 sub declined {
 
     callback(shift);
@@ -168,7 +179,7 @@ __DATA__
         PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok
 
         # 2 run, 1 left behind
-        PerlAuthenHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok
+        PerlAuthenHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok_authen
         PerlAuthenHandler TestHooks::stacked_handlers2::auth_required
 
         # 2 run, 1 left behind

Modified: perl/modperl/trunk/t/preconnection/TestPreConnection/note.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/preconnection/TestPreConnection/note.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/preconnection/TestPreConnection/note.pm (original)
+++ perl/modperl/trunk/t/preconnection/TestPreConnection/note.pm Thu Jun 12 09:11:39 2014
@@ -6,13 +6,16 @@ use warnings FATAL => 'all';
 use Apache2::Connection ();
 
 use Apache::TestTrace;
+use Apache::Test;
+use Apache::TestUtil;
 
 use Apache2::Const -compile => qw(OK);
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 sub handler {
     my Apache2::Connection $c = shift;
 
-    my $ip = $c->remote_ip;
+    my $ip = APACHE24 ? $c->client_ip : $c->remote_ip;
 
     debug "ip: $ip";
 

Modified: perl/modperl/trunk/t/response/TestAPI/access2.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPI/access2.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/access2.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/access2.pm Thu Jun 12 09:11:39 2014
@@ -44,8 +44,9 @@ my %users = (
 
 sub handler {
     my $r = shift;
-
+	print 'xxxxx\n';
     die '$r->some_auth_required failed' unless $r->some_auth_required;
+	
 
     my $satisfies = $r->satisfies;
     die "wanted satisfies=" . Apache2::Const::SATISFY_ALL . ", got $satisfies"
@@ -90,7 +91,10 @@ sub handler {
 
 1;
 __DATA__
+
 <NoAutoConfig>
+<IfModule mod_version.c>
+<IfVersion < 2.3.0>
 <Location /TestAPI__access2>
     PerlAuthenHandler TestAPI::access2
     PerlResponseHandler Apache::TestHandler::ok1
@@ -117,4 +121,6 @@ __DATA__
         AuthGroupFile @DocumentRoot@/api/auth-groups
     </IfModule>
 </Location>
+</IfVersion>
+</IfModule>
 </NoAutoConfig>

Modified: perl/modperl/trunk/t/response/TestAPI/add_config.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPI/add_config.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/add_config.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/add_config.pm Thu Jun 12 09:11:39 2014
@@ -21,6 +21,7 @@ use Apache2::Const -compile => qw(
 
 use constant KEY        => "TestAddConfig";
 use constant APACHE22   => have_min_apache_version('2.2.0');
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 my @directives = (
     {
@@ -53,10 +54,13 @@ sub map2storage {
     };
     $r->pnotes(add_config2 => "$@");
 
-    eval {
-        $r->add_config(['AllowOverride Options=FollowSymLinks'], -1);
-    };
-    $r->pnotes(followsymlinks => "$@");
+    # We can set AllowOverride only from .htacces in 2.4.0+
+    if (!APACHE24) {
+        eval {
+            $r->add_config(['AllowOverride Options=FollowSymLinks'], -1);
+        };
+        $r->pnotes(followsymlinks => "$@");
+    }
 
     eval {
         my $path="/a/path/to/somewhere";
@@ -96,7 +100,12 @@ sub handler : method {
     ok t_cmp $r->pnotes('add_config2'), (APACHE22 ? qr/.+\n/ : '');
     ok t_cmp $r->pnotes('add_config3'), '';
     ok t_cmp $r->pnotes('add_config4'), qr/after server startup/;
-    ok t_cmp $r->pnotes('followsymlinks'), (APACHE22 ? '': qr/.*\n/);
+    if (!APACHE24) {
+        ok t_cmp $r->pnotes('followsymlinks'), (APACHE22 ? '': qr/.*\n/);
+    }
+    else {
+        ok 1;
+    }
 
     my $expect =  Apache2::Const::OPT_ALL |
                   Apache2::Const::OPT_UNSET |
@@ -109,7 +118,12 @@ sub handler : method {
     ok t_cmp $r->allow_options, Apache2::Const::OPT_EXECCGI;
 
     my $opts = APACHE22 ? Apache2::Const::OPT_SYM_LINKS : $expect;
-    ok t_cmp $r->allow_override_opts, $opts;
+    if (!APACHE24) {
+        ok t_cmp $r->allow_override_opts, $opts;
+    }
+    else {
+        ok 1;
+    }
 
     ok t_cmp $r->location, '/a/path/to/somewhere';
 

Modified: perl/modperl/trunk/t/response/TestAPI/aplog.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPI/aplog.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/aplog.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/aplog.pm Thu Jun 12 09:11:39 2014
@@ -17,6 +17,7 @@ use TestCommon::LogDiff;
 
 use Apache2::Const -compile => qw(OK :log);
 use APR::Const    -compile => qw(:error SUCCESS);
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 my @LogLevels = qw(emerg alert crit error warn notice info debug);
 my $package = __PACKAGE__;
@@ -59,6 +60,11 @@ sub handler {
 
     # log_serror
     {
+        my $orig_log_level = 0;
+        if (APACHE24) {
+            $orig_log_level = $s->loglevel;
+            $s->loglevel(Apache2::Const::LOG_DEBUG);
+        }
         t_server_log_warn_is_expected();
         $s->log_serror(Apache2::Log::LOG_MARK,
                        Apache2::Const::LOG_INFO|Apache2::Const::LOG_STARTUP,
@@ -85,6 +91,9 @@ sub handler {
         ok t_cmp $logdiff->diff,
             qr/$egeneral: log_serror test 2/,
             '$s->log_serror(LOG_MARK, LOG_DEBUG, APR::Const::EGENERAL...)';
+        if (APACHE24) {
+            $s->loglevel($orig_log_level);
+        }
     }
 
     # log_rerror
@@ -92,38 +101,73 @@ sub handler {
     $r->log_rerror(Apache2::Log::LOG_MARK, Apache2::Const::LOG_CRIT,
                    APR::Const::ENOTIME, "log_rerror test");
     # can't match against the error string, since a locale may kick in
-    ok t_cmp $logdiff->diff,
-        qr/\[crit\] .*?: log_rerror test/,
-        '$r->log_rerror(LOG_MARK, LOG_CRIT, APR::Const::ENOTIME...)';
+    if (APACHE24) {
+        ok t_cmp $logdiff->diff,
+            qr/\[\w*:crit\] \[pid[^]]+\] .*?: \[[^]]+\] log_rerror test/,
+            '$r->log_rerror(LOG_MARK, LOG_CRIT, APR::Const::ENOTIME...)';
+    }
+    else {
+        ok t_cmp $logdiff->diff,
+            qr/\[crit\] .*?: log_rerror test/,
+            '$r->log_rerror(LOG_MARK, LOG_CRIT, APR::Const::ENOTIME...)';
+    }
 
     # log_error
     {
         t_server_log_error_is_expected();
         $r->log_error('$r->log_error test');
-        ok t_cmp $logdiff->diff,
-            qr/\[error\] \$r->log_error test/,
-            '$r->log_error(...)';
+        if (APACHE24) {
+            ok t_cmp $logdiff->diff,
+                qr/\[\w*:error\] \[pid[^]]+\] \$r->log_error test/,
+                '$r->log_error(...)';
+        }
+        else {
+            ok t_cmp $logdiff->diff,
+                qr/\[error\] \$r->log_error test/,
+                '$r->log_error(...)';
+        }
 
         t_server_log_error_is_expected();
         $s->log_error('$s->log_error test');
-        ok t_cmp $logdiff->diff,
-            qr/\[error\] \$s->log_error test/,
-            '$s->log_error(...)';
+        if (APACHE24) {
+            ok t_cmp $logdiff->diff,
+                qr/\[\w*:error\] \[pid[^]]+\] \$s->log_error test/,
+                '$s->log_error(...)';
+        }
+        else {
+            ok t_cmp $logdiff->diff,
+                qr/\[error\] \$s->log_error test/,
+                '$s->log_error(...)';
+        }
     }
 
     # log_reason
     {
         t_server_log_error_is_expected();
         $r->log_reason('$r->log_reason test');
-        ok t_cmp $logdiff->diff,
-            qr/\[error\] access to.*failed.*reason: \$r->log_reason test/,
-            '$r->log_reason(msg)';
+        if (APACHE24) {
+            ok t_cmp $logdiff->diff,
+                qr/\[\w*:error\] \[pid[^]]+\] access to.*failed.*reason: \$r->log_reason test/,
+                '$r->log_reason(msg)';
+        }
+        else {
+            ok t_cmp $logdiff->diff,
+                qr/\[error\] access to.*failed.*reason: \$r->log_reason test/,
+                '$r->log_reason(msg)';
+        }
 
         t_server_log_error_is_expected();
         $r->log_reason('$r->log_reason filename test','filename');
-        ok t_cmp $logdiff->diff,
-            qr/\[error\] access to filename failed.*\$r->log_reason filename test/,
-            '$r->log_reason(msg, filename)';
+        if (APACHE24) {
+            ok t_cmp $logdiff->diff,
+                qr/\[\w*:error\] \[pid[^]]+\] access to filename failed.*\$r->log_reason filename test/,
+                '$r->log_reason(msg, filename)';
+        }
+        else {
+            ok t_cmp $logdiff->diff,
+                qr/\[error\] access to filename failed.*\$r->log_reason filename test/,
+                '$r->log_reason(msg, filename)';
+        }
     }
 
     # XXX: at the moment we can't change loglevel after server startup
@@ -176,32 +220,60 @@ sub handler {
 
     t_server_log_warn_is_expected();
     $s->warn('$s->warn test');
-    ok t_cmp $logdiff->diff,
-        qr/\[warn\] \$s->warn test/,
-        '$s->warn()';
+    if (APACHE24) {
+        ok t_cmp $logdiff->diff,
+            qr/\[\w*:warn\] \[pid[^]]+\] \$s->warn test/,
+            '$s->warn()';
+    }
+    else {
+        ok t_cmp $logdiff->diff,
+            qr/\[warn\] \$s->warn test/,
+            '$s->warn()';
+    }
 
     {
         t_server_log_warn_is_expected();
         # this uses global server to get $s internally
         Apache2::ServerRec::warn("Apache2::ServerRec::warn test");
-        ok t_cmp $logdiff->diff,
-            qr/\[warn\] Apache2::ServerRec::warn test/,
-            'Apache2::ServerRec::warn() w/o Apache2::RequestUtil->request ';
+        if (APACHE24) {
+            ok t_cmp $logdiff->diff,
+                qr/\[\w*:warn\] \[pid[^]]+\] Apache2::ServerRec::warn test/,
+                'Apache2::ServerRec::warn() w/o Apache2::RequestUtil->request ';
+        }
+        else {
+            ok t_cmp $logdiff->diff,
+                qr/\[warn\] Apache2::ServerRec::warn test/,
+                'Apache2::ServerRec::warn() w/o Apache2::RequestUtil->request ';
+        }
 
         Apache2::RequestUtil->request($r);
         t_server_log_warn_is_expected();
         # this uses the global $r to get $s internally
         Apache2::ServerRec::warn("Apache2::ServerRec::warn test");
-        ok t_cmp $logdiff->diff,
-            qr/\[warn\] Apache2::ServerRec::warn test/,
-            'Apache2::ServerRec::warn() w/ Apache2::RequestUtil->request ';
+        if (APACHE24) {
+            ok t_cmp $logdiff->diff,
+                qr/\[\w*:warn\] \[pid[^]]+\] Apache2::ServerRec::warn test/,
+                'Apache2::ServerRec::warn() w/ Apache2::RequestUtil->request ';
+        }
+        else {
+            ok t_cmp $logdiff->diff,
+                qr/\[warn\] Apache2::ServerRec::warn test/,
+                'Apache2::ServerRec::warn() w/ Apache2::RequestUtil->request ';
+        }
     }
 
     t_server_log_warn_is_expected();
     warn "warn test";
-    ok t_cmp $logdiff->diff,
-        qr/\[warn\] warn test/,
-        'overriden via export warn()';
+    if (APACHE24) {
+        ok t_cmp $logdiff->diff,
+            qr/\[\w*:warn\] \[pid[^]]+\] warn test/,
+            'overriden via export warn()';
+    }
+    else {
+        ok t_cmp $logdiff->diff,
+            qr/\[warn\] warn test/,
+            'overriden via export warn()';
+    }
 
     Apache2::Const::OK;
 }

Modified: perl/modperl/trunk/t/response/TestAPI/conn_rec.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPI/conn_rec.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/conn_rec.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/conn_rec.pm Thu Jun 12 09:11:39 2014
@@ -15,6 +15,8 @@ use Apache2::Connection ();
 
 use Apache2::Const -compile => qw(OK CONN_CLOSE);
 
+use constant APACHE24   => have_min_apache_version('2.4.0');
+
 sub handler {
     my $r = shift;
 
@@ -32,20 +34,39 @@ sub handler {
 
     ok $c->local_addr->isa('APR::SockAddr');
 
-    ok $c->remote_addr->isa('APR::SockAddr');
+    if (APACHE24) {
+        ok $c->client_addr->isa('APR::SockAddr');
 
-    # remote_ip
-    {
-        my $remote_ip_org = $c->remote_ip;
-        my $remote_ip_new = "10.10.10.255";
-        ok $remote_ip_org;
-
-        $c->remote_ip($remote_ip_new);
-        ok t_cmp $c->remote_ip, $remote_ip_new;
-
-        # restore
-        $c->remote_ip($remote_ip_org);
-        ok t_cmp $c->remote_ip, $remote_ip_org;
+        # client_ip
+        {
+            my $client_ip_org = $c->client_ip;
+            my $client_ip_new = "10.10.10.255";
+            ok $client_ip_org;
+
+            $c->client_ip($client_ip_new);
+            ok t_cmp $c->client_ip, $client_ip_new;
+
+            # restore
+            $c->client_ip($client_ip_org);
+            ok t_cmp $c->client_ip, $client_ip_org;
+        }
+    }
+    else {
+        ok $c->remote_addr->isa('APR::SockAddr');
+        # remote_ip
+        {
+            my $remote_ip_org = $c->remote_ip;
+            my $remote_ip_new = "10.10.10.255";
+            ok $remote_ip_org;
+ 
+            $c->remote_ip($remote_ip_new);
+            ok t_cmp $c->remote_ip, $remote_ip_new;
+
+ 
+            # restore
+            $c->remote_ip($remote_ip_org);
+            ok t_cmp $c->remote_ip, $remote_ip_org;
+        }
     }
 
     ok $c->remote_host || 1;

Modified: perl/modperl/trunk/t/response/TestAPI/request_util.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPI/request_util.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/request_util.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/request_util.pm Thu Jun 12 09:11:39 2014
@@ -24,7 +24,8 @@ sub handler {
 
     plan $r, tests => (scalar keys %status_lines) + 11;
 
-    ok $r->default_type;
+    # default_type() is gone as of httpd 2.3.2-dev
+    ok !defined(&Apache2::RequestRec::default_type) || $r->default_type;
 
     my $document_root = $r->document_root;
 

Modified: perl/modperl/trunk/t/response/TestAPR/ipsubnet.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPR/ipsubnet.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPR/ipsubnet.pm (original)
+++ perl/modperl/trunk/t/response/TestAPR/ipsubnet.pm Thu Jun 12 09:11:39 2014
@@ -13,6 +13,7 @@ use APR::IpSubnet ();
 use APR::SockAddr ();
 
 use Apache2::Const -compile => 'OK';
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 sub handler {
     my $r = shift;
@@ -21,24 +22,30 @@ sub handler {
 
     plan $r, tests => 8;
 
-    my $ip = $c->remote_ip;
+    my $ip = APACHE24 ? $c->client_ip : $c->remote_ip;
 
     ok $ip;
 
-    ok t_cmp($c->remote_addr->ip_get, $ip,
-             "remote_ip eq remote_addr->ip_get");
+    if (APACHE24) {
+        ok t_cmp($c->client_addr->ip_get, $ip,
+                "client_ip eq client_addr->ip_get");
+    }
+    else {
+        ok t_cmp($c->remote_addr->ip_get, $ip,
+                "remote_ip eq remote_addr->ip_get");
+    }
 
     {
         my $ipsub = APR::IpSubnet->new($p, $ip);
 
-        ok $ipsub->test($c->remote_addr);
+        ok $ipsub->test(APACHE24 ? $c->client_addr : $c->remote_addr);
     }
 
     # use IP mask
     {
         my $ipsub = APR::IpSubnet->new($p, $ip, "255.0.0.0");
 
-        ok $ipsub->test($c->remote_addr);
+        ok $ipsub->test(APACHE24 ? $c->client_addr : $c->remote_addr);
     }
 
     # fail match
@@ -49,7 +56,7 @@ sub handler {
             (my $mismatch = $ip) =~ s/(?<=\.)(\d+)$/$1 == 255 ? $1-1 : $1+1/e;
             t_debug($mismatch);
             my $ipsub = APR::IpSubnet->new($p, $mismatch, $mismatch);
-            ok ! $ipsub->test($c->remote_addr);
+            ok ! $ipsub->test(APACHE24 ? $c->client_addr : $c->remote_addr);
         }
         else {
             # XXX: similar ipv6 trick?
@@ -77,7 +84,7 @@ sub handler {
         my $table = APR::Table::make(APR::Pool->new, 50);
         $table->set($_ => $_) for 'aa'..'za';
         # now test that we are still OK
-        ok $ipsub->test($c->remote_addr);
+        ok $ipsub->test(APACHE24 ? $c->client_addr : $c->remote_addr);
     }
 
     Apache2::Const::OK;

Modified: perl/modperl/trunk/t/response/TestAPR/sockaddr.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPR/sockaddr.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPR/sockaddr.pm (original)
+++ perl/modperl/trunk/t/response/TestAPR/sockaddr.pm Thu Jun 12 09:11:39 2014
@@ -13,6 +13,7 @@ use Apache2::RequestRec ();
 use APR::SockAddr ();
 
 use Apache2::Const -compile => 'OK';
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 sub handler {
     my $r = shift;
@@ -21,10 +22,15 @@ sub handler {
     plan $r, tests => 4;
 
     my $local  = $c->local_addr;
-    my $remote = $c->remote_addr;
+    my $remote = APACHE24 ? $c->client_addr : $c->remote_addr;
 
     ok t_cmp($local->ip_get,  $c->local_ip,  "local ip");
-    ok t_cmp($remote->ip_get, $c->remote_ip, "remote ip");
+    if (APACHE24) {
+        ok t_cmp($remote->ip_get, $c->client_ip, "client ip");
+    }
+    else {
+        ok t_cmp($remote->ip_get, $c->remote_ip, "remote ip");
+    }
 
     $r->subprocess_env;
     ok t_cmp($local->port,  $ENV{SERVER_PORT}, "local port");

Modified: perl/modperl/trunk/t/response/TestDirective/cmdparms.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestDirective/cmdparms.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestDirective/cmdparms.pm (original)
+++ perl/modperl/trunk/t/response/TestDirective/cmdparms.pm Thu Jun 12 09:11:39 2014
@@ -133,7 +133,7 @@ TestCmdParms "Vhost"
 </Base>
 
 TestCmdParms "Location"
-
-<LimitExcept GET>
-    TestCmdParms "Limit"
-</LimitExcept>
+#FIXME! httpd 2.4 does not allow LimitExcept here
+#<LimitExcept GET>
+    #TestCmdParms "Limit"
+#</LimitExcept>

Modified: perl/modperl/trunk/t/response/TestModperl/setauth.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestModperl/setauth.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestModperl/setauth.pm (original)
+++ perl/modperl/trunk/t/response/TestModperl/setauth.pm Thu Jun 12 09:11:39 2014
@@ -15,7 +15,7 @@ sub handler {
 
     plan $r, tests => 2;
 
-    ok t_cmp($r->auth_type(), undef, 'auth_type');
+     ok t_cmp($r->auth_type(), "none", 'auth_type');
 
     t_server_log_error_is_expected();
     $r->get_basic_auth_pw();

Modified: perl/modperl/trunk/xs/APR/APR/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/APR/APR/Makefile.PL?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/APR/APR/Makefile.PL (original)
+++ perl/modperl/trunk/xs/APR/APR/Makefile.PL Thu Jun 12 09:11:39 2014
@@ -37,7 +37,7 @@ if (BUILD_APREXT) {
     my $mp_apr_lib = $build->mp_apr_lib;
 
     if (CYGWIN) {
-        # For Cygwin compatibility, set $mp_apr_lib before the apru flags
+        # For Cygwin compatibility, set $mp_apr_lib before the apache libs
         $libs = qq{ $mp_apr_lib } . $libs;
     } else {
         $libs .= qq{ $mp_apr_lib };

Modified: perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/APR/Socket/APR__Socket.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/APR/Socket/APR__Socket.h (original)
+++ perl/modperl/trunk/xs/APR/Socket/APR__Socket.h Thu Jun 12 09:11:39 2014
@@ -118,10 +118,10 @@ apr_status_t mpxs_APR__Socket_poll(apr_s
 }
 
 #ifndef WIN32
-static MP_INLINE int mpxs_APR__Socket_fileno(pTHX_ apr_socket_t *sock)
+static MP_INLINE int mpxs_APR__Socket_fileno(pTHX_ apr_socket_t *socket)
 {
     apr_os_sock_t s;
-    apr_os_sock_get(&s, sock);
+    apr_os_sock_get(&s, socket);
     return s;
 }
 #endif

Modified: perl/modperl/trunk/xs/APR/aprext/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/APR/aprext/Makefile.PL?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/APR/aprext/Makefile.PL (original)
+++ perl/modperl/trunk/xs/APR/aprext/Makefile.PL Thu Jun 12 09:11:39 2014
@@ -19,6 +19,8 @@ for (@names) {
     $src{$cfile} = "$srcdir/$cfile";
 }
 
+push @obj, q{modperl_dummy.o};
+
 my @skip = qw(dynamic test);
 push @skip, q{static}
     unless (Apache2::Build::BUILD_APREXT);

Modified: perl/modperl/trunk/xs/Apache2/Access/Apache2__Access.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/Access/Apache2__Access.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/Apache2/Access/Apache2__Access.h (original)
+++ perl/modperl/trunk/xs/Apache2/Access/Apache2__Access.h Thu Jun 12 09:11:39 2014
@@ -19,7 +19,12 @@ static MP_INLINE SV *mpxs_ap_requires(pT
     AV *av;
     HV *hv;
     register int x;
-    const apr_array_header_t *reqs_arr = ap_requires(r);
+    const apr_array_header_t *reqs_arr = 
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || AP_SERVER_MINORVERSION_NUMBER>=3
+        0;
+#else
+        ap_requires(r);
+#endif
     require_line *reqs;
 
     if (!reqs_arr) {
@@ -95,11 +100,18 @@ static MP_INLINE
 const char *mpxs_Apache2__RequestRec_auth_type(pTHX_ request_rec *r,
                                               char *type)
 {
+    const char *ret = NULL;
+
     if (type) {
         mpxs_insert_auth_cfg(aTHX_ r, "AuthType", type);
     }
 
-    return ap_auth_type(r);
+    ret = ap_auth_type(r);
+    if (!ret) {
+        return "none";
+    }
+
+    return ret;
 }
 
 static MP_INLINE

Modified: perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h Thu Jun 12 09:11:39 2014
@@ -349,3 +349,55 @@ void mpxs_Apache2__RequestRec_child_term
     apr_pool_cleanup_register(r->pool, r->pool, child_terminate,
                               apr_pool_cleanup_null);
 }
+
+
+
+static MP_INLINE
+apr_status_t mpxs_ap_register_auth_provider(pTHX_ I32 items, SV **MARK, SV **SP)
+{
+    apr_pool_t *pool;
+    const char *provider_group;
+    const char *provider_name;
+    const char *provider_version;
+    SV *callback1;
+    SV *callback2 = NULL;
+    int type;
+
+    if (items != 7)
+       Perl_croak(aTHX_ "pool, provider_group, provider_name, "
+                        "provider_version, callback1, callback2, type");
+
+    if (SvROK(*MARK) && sv_derived_from(*MARK, "APR::Pool")) {
+        IV tmp = SvIV((SV*)SvRV(*MARK));
+            if (tmp == 0) {
+                Perl_croak(aTHX_ "invalid pool object (already destroyed?)");
+            }
+        pool = INT2PTR(APR__Pool, tmp);
+    }
+    else {
+        Perl_croak(aTHX_ SvROK(*MARK) ?
+                       "pool is not of type APR::Pool" :
+                       "pool is not a blessed reference");
+        }
+
+    MARK++;
+    provider_group = (const char *)SvPV_nolen(*MARK);
+    MARK++;
+    provider_name = (const char *)SvPV_nolen(*MARK);
+    MARK++;
+    provider_version = (const char *)SvPV_nolen(*MARK);
+    MARK++;
+    callback1 = newSVsv(*MARK);
+    MARK++;
+    callback2 = NULL;
+    if (SvROK(*MARK)) {
+        callback2 = newSVsv(*MARK);
+    }
+    MARK++;
+    type = (int)SvIV(*MARK);
+
+    return modperl_register_auth_provider(pool, provider_group, provider_name,
+                                          provider_version, callback1,
+                                          callback2, type);
+}
+

Modified: perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h (original)
+++ perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h Thu Jun 12 09:11:39 2014
@@ -205,3 +205,17 @@ static void mpxs_Apache2__ServerUtil_BOO
     newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_built",
                 newSVpv(ap_get_server_built(), 0));
 }
+
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || \
+    (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER>=3)
+static MP_INLINE
+int mpxs_Apache2__ServerRec_loglevel(pTHX_ server_rec *s, int loglevel)
+{
+    if (loglevel) {
+        s->log.level = loglevel;
+    }
+
+    return s->log.level;
+}
+#endif
+

Modified: perl/modperl/trunk/xs/ModPerl/Const/Const.xs
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/ModPerl/Const/Const.xs?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/ModPerl/Const/Const.xs (original)
+++ perl/modperl/trunk/xs/ModPerl/Const/Const.xs Thu Jun 12 09:11:39 2014
@@ -17,6 +17,23 @@
 #include "mod_perl.h"
 #include "modperl_const.h"
 
+#ifndef WIN32
+/* FIXME: To define extern perl_module to something so Const.so can be
+ * loaded later. Without this code, loading Const.so fails with 
+ * undefined_symbol: perl_module. (Windows does not need this since it
+ * explicitly links against mod_perl.lib anyway.)
+ */
+module AP_MODULE_DECLARE_DATA perl_module = {
+    STANDARD20_MODULE_STUFF,
+    NULL, /* dir config creater */
+    NULL,  /* dir merger --- default is to override */
+    NULL, /* server config */
+    NULL,  /* merge server config */
+    NULL,              /* table of config file commands       */
+    NULL,    /* register hooks */
+};
+#endif
+
 MODULE = ModPerl::Const    PACKAGE = ModPerl::Const
 
 PROTOTYPES: disable

Modified: perl/modperl/trunk/xs/maps/apache2_functions.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/apache2_functions.map?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/apache2_functions.map (original)
+++ perl/modperl/trunk/xs/maps/apache2_functions.map Thu Jun 12 09:11:39 2014
@@ -37,11 +37,26 @@
 
 MODULE=Apache2::RequestUtil
  ap_get_status_line
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+ ap_register_auth_provider | mpxs_ | ...
+#_end_
 
 MODULE=Apache2::RequestUtil   PACKAGE=guess
  ap_psignature | | r, prefix
 >ap_finalize_request_protocol
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } < 2003000
  ap_default_type
+#_end_
  ap_get_server_name
  ap_get_server_port
 !ap_content_type_tolower
@@ -161,6 +176,14 @@ MODULE=Apache2::ServerUtil   PACKAGE=Apa
  int:DEFINE_method_register | | server_rec *:s, const char *:methname
 ~add_version_component
  void:DEFINE_add_version_component | | server_rec *:s, const char *:component
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+ mpxs_Apache2__ServerRec_loglevel | | server_rec *:s, loglevel=NULL
+#_end_
 
 MODULE=Apache2::ServerUtil   PACKAGE=Apache2::ServerUtil
  ap_exists_config_define
@@ -533,3 +556,13 @@ MODULE=Apache2::MPM   PACKAGE=Apache2::M
 ?ap_mpm_set_pidfile
 ?ap_mpm_set_scoreboard
 ?ap_listen_pre_config
+
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+MODULE=Apache2::Provider
+ ap_register_provider
+#_end_

Modified: perl/modperl/trunk/xs/maps/apache2_structures.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/apache2_structures.map?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/apache2_structures.map (original)
+++ perl/modperl/trunk/xs/maps/apache2_structures.map Thu Jun 12 09:11:39 2014
@@ -2,6 +2,20 @@
 
 # for mapping see %ModPerl::MapUtil::disabled_map in
 # lib/ModPerl/MapUtil.pm
+# the mapping happens in lib/ModPerl/StructureMap.pm: sub parse
+#    '<' => 'auto-generated but gives only a read-only access'
+#    '&' => 'RDWR accessor to a char* field, supporting undef arg'
+#    '$' => 'RONLY accessor, with WRITE accessor before child_init'
+#    '%' => like $, but makes sure that for the write accessor the
+#           original perl scalar can change or go away w/o affecting
+#           the object
+# my %disabled_map = (
+#     '!' => 'disabled or not yet implemented',
+#     '~' => 'implemented but not auto-generated',
+#     '-' => 'likely never be available to Perl',
+#     '>' => '"private" to apache',
+#     '?' => 'unclassified',
+# );
 
 IGNORE: ap_LINK_ ap_filter_func ap_bucket_error ap_listen_rec core_net_rec
 
@@ -69,6 +83,15 @@ IGNORE: ap_LINK_ ap_filter_func ap_bucke
    proto_output_filters
    proto_input_filters
 ?  eos_sent
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+<  useragent_addr
+   useragent_ip
+#_end_
 </request_rec>
 
 <server_rec>
@@ -78,11 +101,28 @@ IGNORE: ap_LINK_ ap_filter_func ap_bucke
 -  defn_line_number
 %  server_admin
 %  server_hostname
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+%  server_scheme
+#_end_
 $  port
 %  error_fname
 $  error_log
 $  loglevel
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+~  is_virtual
+#_else_
 <  is_virtual
+#_end_
 <  module_config
 <  lookup_defaults
 <  addrs
@@ -97,6 +137,14 @@ $  keep_alive
 $  limit_req_line
 $  limit_req_fieldsize
 $  limit_req_fields
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+   context
+#_end_
 </server_rec>
 
 <conn_rec>
@@ -104,6 +152,15 @@ $  limit_req_fields
 <  base_server
 >  vhost_lookup_data
 <  local_addr
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+<  client_addr
+   client_ip
+#_end_
 <  local_ip
 <  local_host
 <  remote_addr
@@ -121,6 +178,15 @@ $  limit_req_fields
    output_filters
 <  sbh
 <  bucket_alloc
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+<  log
+<  log_id
+#_end_
 </conn_rec>
 
 !<server_addr_rec>

Modified: perl/modperl/trunk/xs/maps/modperl_functions.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/modperl_functions.map?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/modperl_functions.map (original)
+++ perl/modperl/trunk/xs/maps/modperl_functions.map Thu Jun 12 09:11:39 2014
@@ -22,6 +22,16 @@ MODULE=Apache2::RequestRec   PACKAGE=Apa
  mpxs_Apache2__RequestRec_handler | | ...
  mpxs_Apache2__RequestRec_content_languages | | r, languages=(SV *)NULL
 
+#_if_ do {                                                                  \
+          Apache2::Build->build_config                                      \
+	      ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/                     \
+          ? ($1*1000+$2)*1000+$3                                            \
+          : die "Cannot get httpd version";                                 \
+      } > 2003000
+MODULE=Apache2::ServerRec   PACKAGE=Apache2::ServerRec
+ mpxs_Apache2__ServerRec_is_virtual       | | server_rec *:s, val=(SV *)NULL
+#_end_
+
 MODULE=Apache2::RequestUtil   PACKAGE=guess
  mpxs_Apache2__RequestRec_push_handlers
  mpxs_Apache2__RequestRec_set_handlers

Modified: perl/modperl/trunk/xs/maps/modperl_types.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/modperl_types.map?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/modperl_types.map (original)
+++ perl/modperl/trunk/xs/maps/modperl_types.map Thu Jun 12 09:11:39 2014
@@ -7,6 +7,8 @@ struct modperl_filter_t | Apache2::Outpu
 SV *  | SV
 I32   | IV
 I32 * | IV
+U16   | UV
+U16 * | UV
 U32   | UV
 U32 * | UV
 

Modified: perl/modperl/trunk/xs/tables/current/Apache2/ConstantsTable.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/tables/current/Apache2/ConstantsTable.pm?rev=1602099&r1=1602098&r2=1602099&view=diff
==============================================================================
--- perl/modperl/trunk/xs/tables/current/Apache2/ConstantsTable.pm (original)
+++ perl/modperl/trunk/xs/tables/current/Apache2/ConstantsTable.pm Thu Jun 12 09:11:39 2014
@@ -53,7 +53,6 @@ $Apache2::ConstantsTable = {
       'OPT_EXECCGI',
       'OPT_UNSET',
       'OPT_INCNOEXEC',
-      'OPT_INC_WITH_EXEC',
       'OPT_SYM_OWNER',
       'OPT_MULTI',
       'OPT_ALL'



Mime
View raw message