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,3 +1,3 @@ -vmod-tbf -- history of user-visible changes. 2014-10-31 +vmod-tbf -- history of user-visible changes. 2014-11-13 Copyright (C) 2013-2014 Sergey Poznyakoff See the end of file for copying conditions. @@ -6,5 +6,5 @@ Please send vmod-tbf bug reports to <gray@gnu.org> -Version 1.0.90 (git) +Version 2.0, 2014-11-13 Support for VCL 4.0 diff --git a/configure.ac b/configure.ac index 12790b6..f8e19de 100644 --- a/configure.ac +++ b/configure.ac @@ -15,5 +15,5 @@ # along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. AC_PREREQ(2.69) -AC_INIT([vmod-tbf], 1.0.90, [gray@gnu.org]) +AC_INIT([vmod-tbf], 2.0, [gray@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) 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 @@ -14,5 +14,5 @@ .\" You should have received a copy of the GNU General Public License .\" along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. -.TH VMOD-TBF 1 "November 1, 2014" "VMOD-TBF" "User Reference" +.TH VMOD-TBF 1 "November 13, 2014" "VMOD-TBF" "User Reference" .SH NAME vmod-tbf \- token bucket filtering for Varnish @@ -79,5 +79,5 @@ The function returns \fBTRUE\fR if the data are accepted and sub vcl_recv { if (!tbf.rate("ip:" + client.ip, 1, 0.1s, 20)) { - error 429 "Request rate exceeded." + error(429, "Request rate exceeded"); } } @@ -88,4 +88,13 @@ per second, allowing for bursts of up to 20 requests after each 2 second (or longer) period of inactivity. .PP +For VCL 4.0, replace +.EX + error(429, "Request rate exceeded"); +.EE +with +.EX + return(synth(429, "Request rate exceeded")); +.EE +.PP The \fBtbf.check\fR function provides a higher-level interface. Its first argument identifies the bucket. The \fIrate\fR argument is a @@ -105,5 +114,5 @@ ten and a half requests per second: sub vcl_recv { if (!tbf.check(client.ip, "10.5 req/1s")) { - error 429 "Request rate exceeded." + error(429, "Request rate exceeded"); } } |