summaryrefslogtreecommitdiff
path: root/www-apache/mod_bw/files
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /www-apache/mod_bw/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'www-apache/mod_bw/files')
-rw-r--r--www-apache/mod_bw/files/11_mod_bw.conf16
-rw-r--r--www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch49
2 files changed, 65 insertions, 0 deletions
diff --git a/www-apache/mod_bw/files/11_mod_bw.conf b/www-apache/mod_bw/files/11_mod_bw.conf
new file mode 100644
index 00000000000..1d990612bdc
--- /dev/null
+++ b/www-apache/mod_bw/files/11_mod_bw.conf
@@ -0,0 +1,16 @@
+<IfDefine BW>
+LoadModule bw_module modules/mod_bw.so
+
+# This must be turned on for mod_bandwidth to actually do anything
+# These directives can go inside a VirtualHost or Directory, etc...
+#BandWidthModule On
+
+# Limit 196.168.0.0/24 to 80KB/sec, with a minimum of 60KB/sec
+#BandWidth 196.168.0 80000
+#BandWidth 196.168.0 60000
+
+# Everyone else shares 50KB/sec
+#Bandwidth all 50000
+</IfDefine>
+
+# vim: ts=4 filetype=apache
diff --git a/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch b/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch
new file mode 100644
index 00000000000..27af0dbc1c6
--- /dev/null
+++ b/www-apache/mod_bw/files/mod_bw-0.9.2-apache24.patch
@@ -0,0 +1,49 @@
+--- a/mod_bw.c 2010-07-20 18:14:30.000000000 +0200
++++ b/mod_bw.c 2014-03-31 14:36:27.064883758 +0200
+@@ -105,6 +105,10 @@ Changelog :
+ #define apr_atomic_set32 apr_atomic_set
+ #endif
+
++#define APACHE_VERSION_AT_LEAST(major,minor) \
++(((major) < AP_SERVER_MAJORVERSION_NUMBER) \
++ || ((major) == AP_SERVER_MAJORVERSION_NUMBER && (minor) <= AP_SERVER_MINORVERSION_NUMBER))
++
+ /* Enum types of "from address" */
+ enum from_type {
+ T_ALL,
+@@ -564,7 +568,11 @@ static long get_bw_rate(request_rec * r,
+ return e[i].rate;
+
+ case T_IP:
++#if APACHE_VERSION_AT_LEAST(2,4)
++ if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
++#else
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
++#endif
+ return e[i].rate;
+ }
+ break;
+@@ -655,7 +663,11 @@ static int get_maxconn(request_rec * r,
+ return e[i].max;
+
+ case T_IP:
++#if APACHE_VERSION_AT_LEAST(2,4)
++ if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
++#else
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
++#endif
+ return e[i].max;
+ }
+ break;
+@@ -706,7 +718,11 @@ static int get_sid(request_rec * r, apr_
+ return e[i].sid;
+
+ case T_IP:
++#if APACHE_VERSION_AT_LEAST(2,4)
++ if (apr_ipsubnet_test(e[i].x.ip, r->useragent_addr)) {
++#else
+ if (apr_ipsubnet_test(e[i].x.ip, r->connection->remote_addr)) {
++#endif
+ return e[i].sid;
+ }
+ break;