diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-08-01 19:20:54 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-08-02 10:48:54 +0300 |
commit | 73f605f76d82aec40a7f1bbd309e2097d9abfd42 (patch) | |
tree | 5820713d17efcb482a8801f4f805b0ae121903f7 /src/vmod-tbf.3 | |
parent | d78a58be5fa2385987a3141ccbe942107332e677 (diff) | |
download | vmod-tbf-73f605f76d82aec40a7f1bbd309e2097d9abfd42.tar.gz vmod-tbf-73f605f76d82aec40a7f1bbd309e2097d9abfd42.tar.bz2 |
Switch to CDB environment.
* configure.ac: Version 0.99.91
* src/tbf.c (dbdir): New static.
(tbf_set_db_name): Remove.
(tbf_set_db_dir): New function.
(tbf_open): Rename the parameter and related variables.
Create a CDB environment and the database in it.
(vmod_open): Change semantics of the first argument.
* src/vmod-tbf.3: Update.
* tests/Makefile.am (distclean-local): New rule, instead of
DISTCLEANFILES.
* tests/test00.vtc: Update call to tbf.open.
* tests/test01.vtc: Likewise.
* tests/test02.vtc: Likewise.
* tests/test03.vtc: Likewise.
Diffstat (limited to 'src/vmod-tbf.3')
-rw-r--r-- | src/vmod-tbf.3 | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/vmod-tbf.3 b/src/vmod-tbf.3 index cf12ea7..bd7b233 100644 --- a/src/vmod-tbf.3 +++ b/src/vmod-tbf.3 @@ -13,13 +13,13 @@ .\" .\" 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 "July 23, 2013" "VMOD-TBF" "User Reference" +.TH VMOD-TBF 1 "August 2, 2013" "VMOD-TBF" "User Reference" .SH NAME vmod-tbf \- token bucket filtering for Varnish .SH SYNOPSIS .B import tbf; -.BI "VOID tbf.open(STRING " dbfile ", STRING " params ");" +.BI "VOID tbf.open(STRING " dbdir ", STRING " params ");" .B VOID tbf.close(); @@ -108,13 +108,17 @@ sub vcl_recv { .EE .SS Storage .PP -Buckets are kept in a Berkeley DB file. The \fBtbf.open\fR function -controls its location and permissions. The \fBdbfile\fR argument -supplies the full pathname to the file. The \fBparams\fR argument is -a semicolon separated list of the following parameters: +Buckets are kept in a Berkeley database file. The \fBtbf.open\fR function +controls its location and permissions. The \fBdbdir\fR argument +supplies the full pathname to the directory where the database is +located. The \fBparams\fR argument is a semicolon separated list of +the following parameters: +.TP +.BI dbname= NAME +Sets the name of the database file. Default is \fBtbf.bdb\fR. .TP .BR truncate " or " trunc -Truncate the file if it already exists. +Truncate the database if it already exists. .TP .BI mode= OCT Set the file mode. \fIOCT\fR is an octal number. The default file @@ -141,10 +145,16 @@ Note that the directory where the database file is located must be writable for the user \fBVarnish\fR runs as. .PP Unless the \fBtbf.open\fR function was called, both \fBtbf.rate\fR and -\fBtbf.check\fR will attempt to use the file \fIlocalstatedir\fB/tbf.db\fR, -where \fIlocalstatedir\fR is the directory for modifiable -single-machine data, which is set when configuring the package -(e.g. \fB/var/run/tbf\fR or the like). +\fBtbf.check\fR will attempt to use the database located in +\fIlocalstatedir\fB/vmod-tbf\fR, where \fIlocalstatedir\fR is the +directory for modifiable single-machine data, which is set when +configuring the package (e.g. \fB/var/run\fR or the like). +.PP +If the database directory does not exist, \fBtbf.open\fR will attempt +to create it, deducing its mode from the database file mode (see the +\fBmode=\fR parameter above) by setting executable +bit in each triplet that has read or write bit set (e.g. \fB640\fR +will become \fB750\fR). .PP The \fBtbf.close\fR function flushes the data and closes the database. It is normally called from the \fBvcl_fini\fR subroutine: |