perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgollu...@apache.org
Subject svn commit: r532829 - in /perl/modperl/trunk: ./ src/modules/perl/ t/response/TestAPI/ xs/Apache2/ServerUtil/ xs/maps/ xs/tables/current/Apache2/
Date Thu, 26 Apr 2007 18:13:26 GMT
Author: pgollucci
Date: Thu Apr 26 11:13:25 2007
New Revision: 532829

URL: http://svn.apache.org/viewvc?view=rev&rev=532829
Log:
Catch up with some upstream httpd API changes:

2.2.4:
The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive. ap_get_server_version() is now
deprecated, and is replaced by ap_get_server_banner() and
ap_get_server_description()

2.3.0:
ap_get_server_version() has been removed. Third-party modules must
now use ap_get_server_banner() or ap_get_server_description()

Submitted By: Gozer
Reviewed By: pgollucci



Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c
    perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h
    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
    perl/modperl/trunk/xs/tables/current/Apache2/FunctionTable.pm

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Thu Apr 26 11:13:25 2007
@@ -12,6 +12,19 @@
 
 =item 2.0.4-dev
 
+Catch up with some httpd API changes
+  2.2.4: 
+   The full server version information is now included in the error log at
+startup as well as server status reports, irrespective of the setting
+of the ServerTokens directive. ap_get_server_version() is now
+deprecated, and is replaced by ap_get_server_banner() and
+ap_get_server_description(). [Jeff Trawick]
+
+  2.3.0:
+ap_get_server_version() has been removed. Third-party modules must
+now use ap_get_server_banner() or ap_get_server_description().
+[Gozer]
+
 fixed Apache2::compat Apache2::ServerUtil::server_root() resolution
 issues [Joshua Hoblitt]
 

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?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_apache_compat.c Thu Apr 26 11:13:25 2007
@@ -27,3 +27,45 @@
  * and don't forget to insert comments explaining exactly
  * which httpd release allows us to remove the compat code
  */
+
+/* pre-APACHE_2.2.4 */
+#if ! AP_MODULE_MAGIC_AT_LEAST(20051115,4)
+
+#define modperl_warn_fallback_http_function(ver, fallback) \
+    { \
+        dTHX; \
+        Perl_warn(aTHX_ "%s() not available until httpd/%s " \
+                        "falling back to %s()", \
+                  __func__, ver, fallback); \
+    }
+
+/* added in APACHE_2.2.4 */
+AP_DECLARE(const char *) ap_get_server_description(void) {
+    modperl_warn_fallback_http_function("2.2.4", "ap_get_server_version");
+    return ap_get_server_version();
+}
+
+AP_DECLARE(const char *) ap_get_server_banner(void) {
+    modperl_warn_fallback_http_function("2.2.4", "ap_get_server_version");
+    return ap_get_server_version();
+}
+
+#endif /* pre-APACHE_2.2.4 */
+
+/* since-APACHE-2.3.0 */
+#if AP_MODULE_MAGIC_AT_LEAST(20060905,0)
+#define modperl_warn_deprecated_http_function(ver, fallback) \
+    { \
+        dTHX; \
+        Perl_warn(aTHX_ "%s() is deprecated since httpd/%s " \
+                        "try using %s() instead", \
+                  __func__, ver, fallback); \
+    }
+
+AP_DECLARE(const char *) ap_get_server_version(void) {
+    modperl_warn_deprecated_http_function("2.3.0",
+        "ap_get_server_(description|banner)");
+    return ap_get_server_banner();
+}
+
+#endif /* since-APACHE-2.3.0 */

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?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_apache_compat.h Thu Apr 26 11:13:25 2007
@@ -36,6 +36,23 @@
  * which httpd release allows us to remove the compat code
  */
 
+/* pre-APACHE_2.2.4 */
+#if ! AP_MODULE_MAGIC_AT_LEAST(20051115,4)
+
+/* added in APACHE_2.2.4 */
+AP_DECLARE(const char *) ap_get_server_description(void);
+AP_DECLARE(const char *) ap_get_server_banner(void);
+
+#endif /* pre-APACHE_2.2.4 */
+
+/* since-APACHE-2.3.0 */
+#if AP_MODULE_MAGIC_AT_LEAST(20060905,0)
+
+/* removed in APACHE-2.3.0 */
+AP_DECLARE(const char *) ap_get_server_version(void);
+
+#endif /* since-APACHE-2.3.0 */
+
 /* ap_http_scheme is called ap_http_method in httpd 2.0 */
 #ifndef ap_http_scheme
 #define ap_http_scheme(r) ap_http_method(r)

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?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/t/response/TestAPI/server_const.pm (original)
+++ perl/modperl/trunk/t/response/TestAPI/server_const.pm Thu Apr 26 11:13:25 2007
@@ -24,7 +24,7 @@
 
     my $r = shift;
 
-    plan $r, tests => 3;
+    plan $r, tests => 5;
 
     # test Apache2::ServerUtil constant subroutines
 
@@ -36,9 +36,19 @@
              $built,
              'Apache2::ServerUtil::get_server_built()');
 
-    ok t_cmp(Apache2::ServerUtil::get_server_version,
+    ok t_cmp(Apache2::ServerUtil::get_server_description,
              $version,
+             '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()');
+
+    my $server_banner = Apache2::ServerUtil::get_server_banner;
+    ok t_cmp($version,
+             qr/^$server_banner/,
+             'Apache2::ServerUtil::get_server_banner()');
 
     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?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h (original)
+++ perl/modperl/trunk/xs/Apache2/ServerUtil/Apache2__ServerUtil.h Thu Apr 26 11:13:25 2007
@@ -195,4 +195,10 @@
 
     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?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/xs/maps/apache2_functions.map (original)
+++ perl/modperl/trunk/xs/maps/apache2_functions.map Thu Apr 26 11:13:25 2007
@@ -176,6 +176,8 @@
 !ap_get_local_host
 ~ap_get_server_built
 ~ap_get_server_version
+~ap_get_server_banner
+~ap_get_server_description
 ~ap_server_root
 
 

Modified: perl/modperl/trunk/xs/tables/current/Apache2/FunctionTable.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/tables/current/Apache2/FunctionTable.pm?view=diff&rev=532829&r1=532828&r2=532829
==============================================================================
--- perl/modperl/trunk/xs/tables/current/Apache2/FunctionTable.pm (original)
+++ perl/modperl/trunk/xs/tables/current/Apache2/FunctionTable.pm Thu Apr 26 11:13:25 2007
@@ -1476,6 +1476,16 @@
   },
   {
     'return_type' => 'const char *',
+    'name' => 'ap_get_server_description',
+    'args' => []
+  },
+  {
+    'return_type' => 'const char *',
+    'name' => 'ap_get_server_banner',
+    'args' => []
+  },
+  {
+    'return_type' => 'const char *',
     'name' => 'ap_get_status_line',
     'args' => [
       {



Mime
View raw message