Skip Menu |

This queue is for tickets about the mod_perl CPAN distribution.

Report information
The Basics
Id: 124972
Status: open
Priority: 0/
Queue: mod_perl

People
Owner: Nobody in particular
Requestors: sologuren [...] estudiohum.cl
Cc: fsologuren [...] newtenberg.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: fsologuren [...] newtenberg.com
Subject: Use of deprecated function ap_get_server_version() in Apache httpd 2.4.
When using Apache2::Status over apache httpd 2.4 this warning is thrown to the server log: ------------------------------------8<------------------------------------- ap_get_server_version() is deprecated since httpd/2.3.0 try using ap_get_server_(description|banner)() instead at /usr/lib/x86_64-linux-gnu/perl5/5.20/Apache2/Status.pm line 145, <DATA> line 751. ------------------------------------8<------------------------------------- I am using perl 5, version 20, subversion 2 (v5.20.2) built for x86_64-linux-gnu-thread-multi from Debian Jessie. In the documentation of upgrading to the Apache HTTPD 2.4 API[1] it mentions the deprecation of the function ap_get_server_version() and proposed change it by functions ap_get_server_description() or ap_get_server_banner(). I attached a suggested patch to the Apache2/Status.pm at the header subroutine to use get_server_banner() instead of get_server_version(). I think that Apache2::ServerUtil pod needs an update to the documentation of the function get_server_version too, to reflect the deprecation. Thank you for this great work. Sincerely, Felipe Sologuren Newtenberg.com [1] https://httpd.apache.org/docs/trunk/developer/new_api_2_4.html#upgrading
A +1 here using perl 5.30 and Fedora.
Dne Čt 29.bře.2018 16:29:14, sologuren@estudiohum.cl napsal(a): Show quoted text
> When using Apache2::Status over apache httpd 2.4 this warning is > thrown to the server log: > ------------------------------------8<------------------------------------- > ap_get_server_version() is deprecated since httpd/2.3.0 try using > ap_get_server_(description|banner)() instead at /usr/lib/x86_64-linux- > gnu/perl5/5.20/Apache2/Status.pm line 145, <DATA> line 751. > ------------------------------------8<------------------------------------- > > I am using perl 5, version 20, subversion 2 (v5.20.2) built for > x86_64-linux-gnu-thread-multi from Debian Jessie. > > In the documentation of upgrading to the Apache HTTPD 2.4 API[1] it > mentions the deprecation of the function ap_get_server_version() and > proposed change it by functions ap_get_server_description() or > ap_get_server_banner(). > > I attached a suggested patch to the Apache2/Status.pm at the header > subroutine to use get_server_banner() instead of get_server_version(). > > I think that Apache2::ServerUtil pod needs an update to the > documentation of the function get_server_version too, to reflect the > deprecation. >
An attached patch implements it.
Subject: mod_perl-2.0.11-Do-not-use-deprecated-ap_get_server_version-in-Serve.patch
From e839fb0bb30327de7a1b7ca9cef7c05b4a59eae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Wed, 1 Jul 2020 11:38:44 +0200 Subject: [PATCH] Do not use deprecated ap_get_server_version() in Server::Status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It produced warnings with httpd 2.4. CPAN RT#124972 Signed-off-by: Petr Písař <ppisar@redhat.com> --- docs/api/Apache2/ServerUtil.pod | 3 ++- lib/Apache2/Status.pm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/api/Apache2/ServerUtil.pod b/docs/api/Apache2/ServerUtil.pod index 96e3a28..6828ce8 100644 --- a/docs/api/Apache2/ServerUtil.pod +++ b/docs/api/Apache2/ServerUtil.pod @@ -29,7 +29,6 @@ Apache2::ServerUtil - Perl API for Apache server record utils # server build and version info: $when_built = Apache2::ServerUtil::get_server_built(); $description = Apache2::ServerUtil::get_server_description(); - $version = Apache2::ServerUtil::get_server_version(); $banner = Apache2::ServerUtil::get_server_banner(); # ServerRoot value @@ -365,6 +364,8 @@ Get the server version string $version = Apache2::ServerUtil::get_server_version(); +This function is deprecated. Use C<get_server_banner()> instead. + =over 4 =item ret: C<$version> ( string ) diff --git a/lib/Apache2/Status.pm b/lib/Apache2/Status.pm index 65c3208..ee4bb8c 100644 --- a/lib/Apache2/Status.pm +++ b/lib/Apache2/Status.pm @@ -142,7 +142,7 @@ sub handler { sub header { my $r = shift; my $start = scalar localtime $^T; - my $srv = Apache2::ServerUtil::get_server_version(); + my $srv = Apache2::ServerUtil::get_server_banner(); $r->content_type("text/html"); my $v = $^V ? sprintf "v%vd", $^V : $]; $r->print(<<"EOF"); -- 2.25.4