aboutsummaryrefslogtreecommitdiff
path: root/src/vmod.vcc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-11-01 16:28:19 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-11-01 16:34:10 +0200
commitfffbbfb089847644e2b0281faba2fa892df4f8b9 (patch)
tree83899ca03d92bdb4100c413904c83385ca0c7d6c /src/vmod.vcc
parentc16de06862f9b2106dcb7810fc20856689ef2aa6 (diff)
downloadvmod-binlog-fffbbfb089847644e2b0281faba2fa892df4f8b9.tar.gz
vmod-binlog-fffbbfb089847644e2b0281faba2fa892df4f8b9.tar.bz2
Support for VCL 4.0
* configure.ac: Version 1.0.91 Detect varnish version and set variables and conditionals accordingly. * NEWS: Update. * src/.gitignore: Update. * src/Makefile.am: Always build vcc_if.c and vcc_if.h. Don't distribute them. * src/binlog.c: Use VCL data type. Define them for VCL 3.0. (vmod_init): Fix premature memory deallocation. * src/vmod.vcc: Rewrite in VCL 4.0 syntax. * tests/atlocal.in (ret_vcl_recv): New variable. * tests/test01.at (vcl_recv): Return $ret_vcl_recv. * tests/test02.at: Likewise.
Diffstat (limited to 'src/vmod.vcc')
-rw-r--r--src/vmod.vcc111
1 files changed, 103 insertions, 8 deletions
diff --git a/src/vmod.vcc b/src/vmod.vcc
index 45da354..b090797 100644
--- a/src/vmod.vcc
+++ b/src/vmod.vcc
@@ -1,8 +1,103 @@
1Module binlog 1# This file is part of vmod-binlog
2Init module_init 2# Copyright (C) 2013-2014 Sergey Poznyakoff
3Function VOID init(PRIV_VCL, STRING, STRING, STRING) 3#
4Function VOID start(PRIV_VCL) 4# Vmod-binlog is free software; you can redistribute it and/or modify
5Function VOID commit(PRIV_VCL) 5# it under the terms of the GNU General Public License as published by
6Function VOID pack(PRIV_VCL, STRING) 6# the Free Software Foundation; either version 3, or (at your option)
7Function VOID sync(PRIV_VCL) 7# any later version.
8Function VOID close(PRIV_VCL) 8#
9# Vmod-binlog is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with vmod-binlog. If not, see <http://www.gnu.org/licenses/>.
16
17$Module binlog 3 Binary Log File Support
18
19COLOPHON
20========
21This document provides a short description of the **vmod-binlog** module.
22For a detailed documentation, please see the vmod-binlog(3) manual page.
23
24You will find documentation sources in subdirectory **doc** of the
25**vmod-binlog** source tree.
26
27DESCRIPTION
28===========
29This module adds binary log files support to Varnish Cache.
30
31Binary log file consists of an arbitrary number of equally sized
32records. Each record contains a UNIX timestamp in binary form and
33user-defined data. The file begins with a header containing auxiliary
34information.
35
36Binary log files are rotated at preconfigured time intervals. In order
37to speed up searches, their names follow the strftime(3) pattern:
38
39%Y%m%dT%H%M%S.log
40
41Binary logs can be viewed using the binlogcat(1) and binlogsel(1) utilities.
42
43$Init module_init
44$Function VOID init(PRIV_VCL, STRING, STRING, STRING)
45
46Description
47 Initializes binary log engine.
48Example
49 ::
50
51 binlog.init("/var/lib/varnish/binlog", "LZ[64]L",
52 "size=1G;index=1;umask=027;roundts=1;debug=2");
53
54
55$Function VOID start(PRIV_VCL)
56
57Description
58 Initialize new binary record. It should be followed by one or
59 more calls to **binlog.pack** and a final call to **binlog.commit**.
60Example
61 ::
62 binlog.start();
63
64$Function VOID pack(PRIV_VCL, STRING)
65
66Description
67 Pack next data item into the binary log record. The item is
68 converted according to the second argument of **binlog.init**.
69 The conversion specifier is selected using the ordinal number
70 of this **pack** call after the latest **binlog.start**.
71
72$Function VOID commit(PRIV_VCL)
73
74Description
75 Finalize the binary log record and commit it. Any uninitialized
76 fields will be set to 0.
77
78Example
79 ::
80
81 binlog.start();
82 binlog.pack(http.X-Id);
83 binlog.pack(http.req.url);
84 binlog.pack(http.X-Node);
85 binlog.commit();
86
87$Function VOID sync(PRIV_VCL)
88
89Description
90 Synchronize the binary log with the disk file.
91
92$Function VOID close(PRIV_VCL)
93
94Description
95 Close the log. This is supposed to be called from **vcl_fini**.
96
97SEE ALSO
98========
99
100* binlogcat(1)
101* binlogsel(1)
102* vcl(7)
103* varnishd(1)

Return to:

Send suggestions and report system problems to the System administrator.