diff options
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 @@ | |||
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 "July 23, 2013" "VMOD-TBF" "User Reference" | 16 | .TH VMOD-TBF 1 "August 2, 2013" "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 |
20 | .B import tbf; | 20 | .B import tbf; |
21 | 21 | ||
22 | .BI "VOID tbf.open(STRING " dbfile ", STRING " params ");" | 22 | .BI "VOID tbf.open(STRING " dbdir ", STRING " params ");" |
23 | 23 | ||
24 | .B VOID tbf.close(); | 24 | .B VOID tbf.close(); |
25 | 25 | ||
@@ -108,13 +108,17 @@ sub vcl_recv { | |||
108 | .EE | 108 | .EE |
109 | .SS Storage | 109 | .SS Storage |
110 | .PP | 110 | .PP |
111 | Buckets are kept in a Berkeley DB file. The \fBtbf.open\fR function | 111 | Buckets are kept in a Berkeley database file. The \fBtbf.open\fR function |
112 | controls its location and permissions. The \fBdbfile\fR argument | 112 | controls its location and permissions. The \fBdbdir\fR argument |
113 | supplies the full pathname to the file. The \fBparams\fR argument is | 113 | supplies the full pathname to the directory where the database is |
114 | a semicolon separated list of the following parameters: | 114 | located. The \fBparams\fR argument is a semicolon separated list of |
115 | the following parameters: | ||
116 | .TP | ||
117 | .BI dbname= NAME | ||
118 | Sets the name of the database file. Default is \fBtbf.bdb\fR. | ||
115 | .TP | 119 | .TP |
116 | .BR truncate " or " trunc | 120 | .BR truncate " or " trunc |
117 | Truncate the file if it already exists. | 121 | Truncate the database if it already exists. |
118 | .TP | 122 | .TP |
119 | .BI mode= OCT | 123 | .BI mode= OCT |
120 | Set the file mode. \fIOCT\fR is an octal number. The default file | 124 | 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 | |||
141 | writable for the user \fBVarnish\fR runs as. | 145 | writable for the user \fBVarnish\fR runs as. |
142 | .PP | 146 | .PP |
143 | Unless the \fBtbf.open\fR function was called, both \fBtbf.rate\fR and | 147 | Unless the \fBtbf.open\fR function was called, both \fBtbf.rate\fR and |
144 | \fBtbf.check\fR will attempt to use the file \fIlocalstatedir\fB/tbf.db\fR, | 148 | \fBtbf.check\fR will attempt to use the database located in |
145 | where \fIlocalstatedir\fR is the directory for modifiable | 149 | \fIlocalstatedir\fB/vmod-tbf\fR, where \fIlocalstatedir\fR is the |
146 | single-machine data, which is set when configuring the package | 150 | directory for modifiable single-machine data, which is set when |
147 | (e.g. \fB/var/run/tbf\fR or the like). | 151 | configuring the package (e.g. \fB/var/run\fR or the like). |
152 | .PP | ||
153 | If the database directory does not exist, \fBtbf.open\fR will attempt | ||
154 | to create it, deducing its mode from the database file mode (see the | ||
155 | \fBmode=\fR parameter above) by setting executable | ||
156 | bit in each triplet that has read or write bit set (e.g. \fB640\fR | ||
157 | will become \fB750\fR). | ||
148 | .PP | 158 | .PP |
149 | The \fBtbf.close\fR function flushes the data and closes the database. | 159 | The \fBtbf.close\fR function flushes the data and closes the database. |
150 | It is normally called from the \fBvcl_fini\fR subroutine: | 160 | It is normally called from the \fBvcl_fini\fR subroutine: |