diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-11-13 11:50:00 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-11-13 11:50:00 +0200 |
commit | 67731a160cc7c3e090236316af459f695593fc55 (patch) | |
tree | 2388e9b8c7820b5d36bf945989f58d7254241ae6 | |
parent | 5bf995011f95b10ae03281119249f8ccb95e8496 (diff) | |
download | vmod-tbf-67731a160cc7c3e090236316af459f695593fc55.tar.gz vmod-tbf-67731a160cc7c3e090236316af459f695593fc55.tar.bz2 |
Version 2.0release-2.0
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/vmod-tbf.3 | 15 |
3 files changed, 15 insertions, 6 deletions
@@ -1,11 +1,11 @@ | |||
1 | vmod-tbf -- history of user-visible changes. 2014-10-31 | 1 | vmod-tbf -- history of user-visible changes. 2014-11-13 |
2 | Copyright (C) 2013-2014 Sergey Poznyakoff | 2 | Copyright (C) 2013-2014 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
5 | Please send vmod-tbf bug reports to <gray@gnu.org> | 5 | Please send vmod-tbf bug reports to <gray@gnu.org> |
6 | 6 | ||
7 | 7 | ||
8 | Version 1.0.90 (git) | 8 | Version 2.0, 2014-11-13 |
9 | 9 | ||
10 | Support for VCL 4.0 | 10 | Support for VCL 4.0 |
11 | 11 | ||
diff --git a/configure.ac b/configure.ac index 12790b6..f8e19de 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -14,7 +14,7 @@ | |||
14 | # You should have received a copy of the GNU General Public License | 14 | # You should have received a copy of the GNU General Public License |
15 | # along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. |
16 | AC_PREREQ(2.69) | 16 | AC_PREREQ(2.69) |
17 | AC_INIT([vmod-tbf], 1.0.90, [gray@gnu.org]) | 17 | AC_INIT([vmod-tbf], 2.0, [gray@gnu.org]) |
18 | AC_CONFIG_AUX_DIR([build-aux]) | 18 | AC_CONFIG_AUX_DIR([build-aux]) |
19 | AC_CONFIG_MACRO_DIR([m4]) | 19 | AC_CONFIG_MACRO_DIR([m4]) |
20 | AC_CONFIG_SRCDIR(src/vmod_tbf.vcc) | 20 | AC_CONFIG_SRCDIR(src/vmod_tbf.vcc) |
diff --git a/src/vmod-tbf.3 b/src/vmod-tbf.3 index 6ab2f63..03d7daf 100644 --- a/src/vmod-tbf.3 +++ b/src/vmod-tbf.3 | |||
@@ -13,7 +13,7 @@ | |||
13 | .\" | 13 | .\" |
14 | .\" You should have received a copy of the GNU General Public License | 14 | .\" You should have received a copy of the GNU General Public License |
15 | .\" along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. | 15 | .\" along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. |
16 | .TH VMOD-TBF 1 "November 1, 2014" "VMOD-TBF" "User Reference" | 16 | .TH VMOD-TBF 1 "November 13, 2014" "VMOD-TBF" "User Reference" |
17 | .SH NAME | 17 | .SH NAME |
18 | vmod-tbf \- token bucket filtering for Varnish | 18 | vmod-tbf \- token bucket filtering for Varnish |
19 | .SH SYNOPSIS | 19 | .SH SYNOPSIS |
@@ -78,7 +78,7 @@ The function returns \fBTRUE\fR if the data are accepted and | |||
78 | .EX | 78 | .EX |
79 | sub vcl_recv { | 79 | sub vcl_recv { |
80 | if (!tbf.rate("ip:" + client.ip, 1, 0.1s, 20)) { | 80 | if (!tbf.rate("ip:" + client.ip, 1, 0.1s, 20)) { |
81 | error 429 "Request rate exceeded." | 81 | error(429, "Request rate exceeded"); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | .EE | 84 | .EE |
@@ -87,6 +87,15 @@ This example will keep the incoming requests at the rate of 10 requests | |||
87 | per second, allowing for bursts of up to 20 requests after each 2 | 87 | per second, allowing for bursts of up to 20 requests after each 2 |
88 | second (or longer) period of inactivity. | 88 | second (or longer) period of inactivity. |
89 | .PP | 89 | .PP |
90 | For VCL 4.0, replace | ||
91 | .EX | ||
92 | error(429, "Request rate exceeded"); | ||
93 | .EE | ||
94 | with | ||
95 | .EX | ||
96 | return(synth(429, "Request rate exceeded")); | ||
97 | .EE | ||
98 | .PP | ||
90 | The \fBtbf.check\fR function provides a higher-level interface. Its | 99 | The \fBtbf.check\fR function provides a higher-level interface. Its |
91 | first argument identifies the bucket. The \fIrate\fR argument is a | 100 | first argument identifies the bucket. The \fIrate\fR argument is a |
92 | textual rate specification in the form: | 101 | textual rate specification in the form: |
@@ -104,7 +113,7 @@ ten and a half requests per second: | |||
104 | .EX | 113 | .EX |
105 | sub vcl_recv { | 114 | sub vcl_recv { |
106 | if (!tbf.check(client.ip, "10.5 req/1s")) { | 115 | if (!tbf.check(client.ip, "10.5 req/1s")) { |
107 | error 429 "Request rate exceeded." | 116 | error(429, "Request rate exceeded"); |
108 | } | 117 | } |
109 | } | 118 | } |
110 | .EE | 119 | .EE |