perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tors...@apache.org
Subject svn commit: r1083541 - in /perl/modperl/trunk: Changes t/response/TestAPI/server_const.pm xs/Apache2/ServerUtil/Apache2__ServerUtil.h xs/maps/apache2_functions.map
Date Sun, 20 Mar 2011 19:15:20 GMT
Author: torsten
Date: Sun Mar 20 19:15:20 2011
New Revision: 1083541

URL: http://svn.apache.org/viewvc?rev=1083541&view=rev
Log:
Bugfix: Apache2::ServerUtil::get_server{description,banner,version} cannot
be declared as perl constants or they won't reflect added version components
if Apache2::ServerUtil is loaded before the PostConfig phase. Now, they
are ordinary perl functions.

Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/t/response/TestAPI/server_const.pm
    perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
    perl/modperl/trunk/xs/maps/apache2_functions.map

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=1083541&r1=1083540&r2=1083541&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Sun Mar 20 19:15:20 2011
@@ -12,6 +12,11 @@ Also refer to the Apache::Test changes l
 
 =item 2.0.6-dev
 
+Bugfix: Apache2::ServerUtil::get_server{description,banner,version} cannot
+be declared as perl constants or they won't reflect added version components
+if Apache2::ServerUtil is loaded before the PostConfig phase. Now, they
+are ordinary perl functions. [Torsten Foertsch]
+
 Check for the right ExtUtils::Embed version during build [Torsten Foertsch]
 
 Take a lesson from rt.cpan.org #66085 and pass LD_LIBRARY_PATH if mod_env

Modified: perl/modperl/trunk/t/response/TestAPI/server_const.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPI/server_const.pm?rev=1083541&r1=1083540&r2=1083541&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/server_const.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/server_const.pm Sun Mar 20 19:15:20 2011
@@ -24,7 +24,7 @@ sub handler {
 
     my $r = shift;
 
-    plan $r, tests => 5;
+    plan $r, tests => 6;
 
     # test Apache2::ServerUtil constant subroutines
 
@@ -36,20 +36,22 @@ sub handler {
              $built,
              'Apache2::ServerUtil::get_server_built()');
 
-    ok t_cmp(Apache2::ServerUtil::get_server_description,
-             $version,
+    my $server_descr = Apache2::ServerUtil::get_server_description;
+    ok t_cmp($server_descr, qr/^\Q$version\E/,
              'Apache2::ServerUtil::get_server_description()');
 
-    my $server_version = Apache2::ServerUtil::get_server_version;
-    ok t_cmp($version,
-             qr/^$server_version/,
-             'Apache2::ServerUtil::get_server_version()');
+    # added via $s->add_version_component in t/conf/modperl_extra.pl
+    ok t_cmp($server_descr, qr!\bworld domination series/2\.0\b!,
+             'Apache2::ServerUtil::get_server_description() -- component');
 
-    my $server_banner = Apache2::ServerUtil::get_server_banner;
-    ok t_cmp($version,
-             qr/^$server_banner/,
+    # assuming ServerTokens Full (default) the banner equals description
+    ok t_cmp(Apache2::ServerUtil::get_server_banner, $server_descr,
              'Apache2::ServerUtil::get_server_banner()');
 
+    # version is just an alias for banner
+    ok t_cmp(Apache2::ServerUtil::get_server_version, $server_descr,
+             'Apache2::ServerUtil::get_server_version()');
+
     Apache2::Const::OK;
 }
 

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=1083541&r1=1083540&r2=1083541&view=diff
==============================================================================
--- perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h (original)
+++ perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h Sun Mar 20 19:15:20 2011
@@ -185,6 +185,13 @@ void mpxs_Apache2__ServerRec_add_config(
     }
 }
 
+#define mpxs_Apache2__ServerRec_get_server_banner         \
+    ap_get_server_banner()
+#define mpxs_Apache2__ServerRec_get_server_description    \
+    ap_get_server_description()
+#define mpxs_Apache2__ServerRec_get_server_version        \
+    ap_get_server_version()
+
 static void mpxs_Apache2__ServerUtil_BOOT(pTHX)
 {
     newCONSTSUB(PL_defstash, "Apache2::ServerUtil::server_root",
@@ -192,13 +199,4 @@ static void mpxs_Apache2__ServerUtil_BOO
 
     newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_built",
                 newSVpv(ap_get_server_built(), 0));
-
-    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_version",
-                newSVpv(ap_get_server_version(), 0));
-
-    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_banner",
-                newSVpv(ap_get_server_banner(), 0));
-
-    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_description",
-                newSVpv(ap_get_server_description(), 0));
 }

Modified: perl/modperl/trunk/xs/maps/apache2_functions.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/apache2_functions.map?rev=1083541&r1=1083540&r2=1083541&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/apache2_functions.map (original)
+++ perl/modperl/trunk/xs/maps/apache2_functions.map Sun Mar 20 19:15:20 2011
@@ -165,6 +165,9 @@ MODULE=Apache2::ServerUtil   PACKAGE=Apa
 MODULE=Apache2::ServerUtil   PACKAGE=Apache2::ServerUtil
  ap_exists_config_define
  ap_server_root_relative | | p, fname=""
+ ap_get_server_banner
+ ap_get_server_description
+ ap_get_server_version
 
 MODULE=Apache2::ServerUtil   PACKAGE=guess
  ap_error_log2stderr
@@ -175,9 +178,6 @@ MODULE=Apache2::ServerUtil   PACKAGE=gue
 #however it is not exported on win32
 !ap_get_local_host
 ~ap_get_server_built
-~ap_get_server_version
-~ap_get_server_banner
-~ap_get_server_description
 ~ap_server_root
 
 



Mime
View raw message