[libapache2-mod-perl2] 03/12: Fix t/compat/conn_rec.t failures by restoring httpd-2.4 compatibility in lib/Apache2/compat.pm.

Niko Tyni ntyni at moszumanska.debian.org
Thu Aug 7 20:13:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

ntyni pushed a commit to branch master
in repository libapache2-mod-perl2.

commit 989f0a538db8c7ee4231247f5f7ff2d259ca1b90
Author: Niko Tyni <ntyni at debian.org>
Date:   Thu Aug 7 17:27:39 2014 +0300

    Fix t/compat/conn_rec.t failures by restoring httpd-2.4 compatibility in lib/Apache2/compat.pm.
---
 debian/changelog                                   |  2 ++
 ...pd-2.4-compatibility-in-lib-Apache2-compa.patch | 39 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 42 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1547d7b..fc8c5c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,8 @@ libapache2-mod-perl2 (2.0.9~1604013-1) UNRELEASED; urgency=medium
     (Closes: #710327)
   * Fix builds with gcc -O0 (DEB_BUILD_OPTIONS=noopt) by defining
     MP_IN_XS in APR and APR/PerlIO builds. (Closes: #756989)
+  * Fix t/compat/conn_rec.t failures by restoring httpd-2.4 compatibility
+    in lib/Apache2/compat.pm.
 
  -- gregor herrmann <gregoa at debian.org>  Sat, 15 Feb 2014 20:25:47 +0100
 
diff --git a/debian/patches/410-Restore-httpd-2.4-compatibility-in-lib-Apache2-compa.patch b/debian/patches/410-Restore-httpd-2.4-compatibility-in-lib-Apache2-compa.patch
new file mode 100644
index 0000000..236baf2
--- /dev/null
+++ b/debian/patches/410-Restore-httpd-2.4-compatibility-in-lib-Apache2-compa.patch
@@ -0,0 +1,39 @@
+From f1f1b1de72ee8be062bf6fa28410feb023c5efc2 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Thu, 7 Aug 2014 00:18:23 +0300
+Subject: [PATCH 2/3] Restore httpd-2.4 compatibility in lib/Apache2/compat.pm
+
+This fixes t/compat/conn_rec.t. failures with Apache 2.4,
+broken with r1497279.
+
+Apache2::compat is supposed to provide mod_perl 1.0 backward
+compatibility, so we want to offer remote_addr() there even with
+Apache 2.4.
+
+Upstream thread at
+ http://mail-archives.apache.org/mod_mbox/perl-dev/201408.mbox/%3C20140807113247.GA30569%40estella.local.invalid%3E
+---
+ lib/Apache2/compat.pm | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/Apache2/compat.pm b/lib/Apache2/compat.pm
+index e7e2c0f..9c3eccd 100644
+--- a/lib/Apache2/compat.pm
++++ b/lib/Apache2/compat.pm
+@@ -150,7 +150,12 @@ EOI
+     require Apache2::Connection;
+     require APR::SockAddr;
+     require Socket;
+-    my $orig_sub = *Apache2::Connection::remote_addr{CODE};
++    my $orig_sub;
++    if (defined *Apache2::Connection::client_addr{CODE}) { # httpd-2.4
++        $orig_sub = *Apache2::Connection::client_addr{CODE};
++    } else { # httpd-2.2
++        $orig_sub = *Apache2::Connection::remote_addr{CODE};
++    }
+     *Apache2::Connection::remote_addr = sub {
+         my $c = shift;
+         if (@_) {
+-- 
+2.1.0.rc1
+
diff --git a/debian/patches/series b/debian/patches/series
index de3ff39..6e907ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@ avoid-db-linkage.patch
 380-Fix-reload.t-as-per-r1565579.-Reported-in-CPAN-RT-96.patch
 390-Disable-the-tree-dse-gcc-optimization-for-modperl_en.patch
 400-Define-MP_IN_XS-to-avoid-referencing-perl_module-out.patch
+410-Restore-httpd-2.4-compatibility-in-lib-Apache2-compa.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libapache2-mod-perl2.git



More information about the Pkg-perl-cvs-commits mailing list