Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-apache/mod_bw/files: mod_bw-0.9.2-apache24.patch
Date: Mon, 09 Jun 2014 11:59:55
Message-Id: 20140609115951.565212004E@flycatcher.gentoo.org
1 pacho 14/06/09 11:59:51
2
3 Added: mod_bw-0.9.2-apache24.patch
4 Log:
5 Apply patch to be compatible with apache-2.4 (#506610 by Fabian Henze)
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
8
9 Revision Changes Path
10 1.1 www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch?rev=1.1&content-type=text/plain
14
15 Index: mod_bw-0.9.2-apache24.patch
16 ===================================================================
17 --- a/mod_bw.c 2010-07-20 18:14:30.000000000 +0200
18 +++ b/mod_bw.c 2014-03-31 14:36:27.064883758 +0200
19 @@ -105,6 +105,10 @@ Changelog :
20 #define apr_atomic_set32 apr_atomic_set
21 #endif
22
23 +#define APACHE_VERSION_AT_LEAST(major,minor) \
24 +(((major) < AP_SERVER_MAJORVERSION_NUMBER) \
25 + || ((major) == AP_SERVER_MAJORVERSION_NUMBER && (minor) <= AP_SERVER_MINORVERSION_NUMBER))
26 +
27 /* Enum types of "from address" */
28 enum from_type {
29 T_ALL,
30 @@ -564,7 +568,11 @@ static long get_bw_rate(request_rec * r,
31 return e[i].rate;
32
33 case T_IP:
34 +#if APACHE_VERSION_AT_LEAST(2,4)
35 + if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
36 +#else
37 if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
38 +#endif
39 return e[i].rate;
40 }
41 break;
42 @@ -655,7 +663,11 @@ static int get_maxconn(request_rec * r,
43 return e[i].max;
44
45 case T_IP:
46 +#if APACHE_VERSION_AT_LEAST(2,4)
47 + if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
48 +#else
49 if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
50 +#endif
51 return e[i].max;
52 }
53 break;
54 @@ -706,7 +718,11 @@ static int get_sid(request_rec * r, apr_
55 return e[i].sid;
56
57 case T_IP:
58 +#if APACHE_VERSION_AT_LEAST(2,4)
59 + if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
60 +#else
61 if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
62 +#endif
63 return e[i].sid;
64 }
65 break;