[mod_bw] Fix compilation with httpd-2.4 (Jan Kaluza)
Jakub Hrozek
jhrozek at fedoraproject.org
Tue Apr 10 10:16:26 UTC 2012
commit 30d477fc3b7f7249b7840a01614d4837373936d9
Author: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue Apr 10 12:16:14 2012 +0200
Fix compilation with httpd-2.4 (Jan Kaluza)
mod_bw-httpd24.patch | 42 ++++++++++++++++++++++++++++++++++++++++++
mod_bw.spec | 11 +++++++++--
2 files changed, 51 insertions(+), 2 deletions(-)
---
diff --git a/mod_bw-httpd24.patch b/mod_bw-httpd24.patch
new file mode 100644
index 0000000..d49d310
--- /dev/null
+++ b/mod_bw-httpd24.patch
@@ -0,0 +1,42 @@
+diff -up mod_bw/mod_bw.c.httpd24 mod_bw/mod_bw.c
+--- mod_bw/mod_bw.c.httpd24 2012-04-10 11:57:06.092958430 +0200
++++ mod_bw/mod_bw.c 2012-04-10 11:59:51.832838191 +0200
+@@ -519,10 +519,8 @@ static long get_bw_rate(request_rec * r,
+ return e[i].rate;
+
+ case T_IP:
+- if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
+- return e[i].rate;
+- }
+- break;
++ return e[i].rate;
++
+ case T_HOST:
+ if (!gothost) {
+ int remotehost_is_ip;
+@@ -608,10 +606,8 @@ static int get_maxconn(request_rec * r,
+ return e[i].max;
+
+ case T_IP:
+- if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
+- return e[i].max;
+- }
+- break;
++ return e[i].max;
++
+ case T_HOST:
+ if (!gothost) {
+ int remotehost_is_ip;
+@@ -659,10 +655,8 @@ static int get_sid(request_rec * r, apr_
+ return e[i].sid;
+
+ case T_IP:
+- if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
+- return e[i].sid;
+- }
+- break;
++ return e[i].sid;
++
+ case T_HOST:
+ if (!gothost) {
+ int remotehost_is_ip;
diff --git a/mod_bw.spec b/mod_bw.spec
index 8f3f639..783b351 100644
--- a/mod_bw.spec
+++ b/mod_bw.spec
@@ -1,8 +1,9 @@
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
+%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
Name: mod_bw
Version: 0.8
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: Bandwidth Limiter For Apache
Group: System Environment/Daemons
@@ -10,6 +11,7 @@ License: ASL 2.0
URL: http://www.ivn.cl/apache
Source0: http://www.ivn.cl/apache/files/source/mod_bw-%{version}.tgz
Source1: mod_bw.conf
+Patch0: mod_bw-httpd24.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd-devel
@@ -23,12 +25,13 @@ mod_bw is a bandwidth administration module for Apache httpd 2.x
%prep
%setup -q -n mod_bw
+%patch0 -p1 -b .httpd24
mv mod_bw.txt mod_bw.txt.iso8859
iconv -f ISO-8859-1 -t UTF-8 mod_bw.txt.iso8859 > mod_bw.txt
%build
-%{_sbindir}/apxs -Wc,"%{optflags}" -c mod_bw.c
+%{_httpd_apxs} -Wc,"%{optflags}" -c mod_bw.c
%install
@@ -51,6 +54,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Tue Apr 10 2012 - Jakub Hrozek <jhrozek at redhat.com> 0.8-8
+- Fix compilation with httpd-2.4 (Jan Kaluza <jkaluza at redhat.com>)
+- Provide backwards-compatible _httpd_apxs macro
+
* Wed Mar 14 2012 Jakub Hrozek <jhrozek at redhat.com> - 0.8-7
- Do not require httpd itself
More information about the scm-commits
mailing list