summaryrefslogtreecommitdiffabout
path: root/src/vmod.vcc
authorSergey Poznyakoff <gray@gnu.org.ua>2014-11-01 14:28:19 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2014-11-01 14:34:10 (GMT)
commitfffbbfb089847644e2b0281faba2fa892df4f8b9 (patch) (side-by-side diff)
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') (more/less context) (ignore whitespace changes)
-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 @@
-Module binlog
-Init module_init
-Function VOID init(PRIV_VCL, STRING, STRING, STRING)
-Function VOID start(PRIV_VCL)
-Function VOID commit(PRIV_VCL)
-Function VOID pack(PRIV_VCL, STRING)
-Function VOID sync(PRIV_VCL)
-Function VOID close(PRIV_VCL)
+# This file is part of vmod-binlog
+# Copyright (C) 2013-2014 Sergey Poznyakoff
+#
+# Vmod-binlog is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Vmod-binlog is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with vmod-binlog. If not, see <http://www.gnu.org/licenses/>.
+
+$Module binlog 3 Binary Log File Support
+
+COLOPHON
+========
+This document provides a short description of the **vmod-binlog** module.
+For a detailed documentation, please see the vmod-binlog(3) manual page.
+
+You will find documentation sources in subdirectory **doc** of the
+**vmod-binlog** source tree.
+
+DESCRIPTION
+===========
+This module adds binary log files support to Varnish Cache.
+
+Binary log file consists of an arbitrary number of equally sized
+records. Each record contains a UNIX timestamp in binary form and
+user-defined data. The file begins with a header containing auxiliary
+information.
+
+Binary log files are rotated at preconfigured time intervals. In order
+to speed up searches, their names follow the strftime(3) pattern:
+
+%Y%m%dT%H%M%S.log
+
+Binary logs can be viewed using the binlogcat(1) and binlogsel(1) utilities.
+
+$Init module_init
+$Function VOID init(PRIV_VCL, STRING, STRING, STRING)
+
+Description
+ Initializes binary log engine.
+Example
+ ::
+
+ binlog.init("/var/lib/varnish/binlog", "LZ[64]L",
+ "size=1G;index=1;umask=027;roundts=1;debug=2");
+
+
+$Function VOID start(PRIV_VCL)
+
+Description
+ Initialize new binary record. It should be followed by one or
+ more calls to **binlog.pack** and a final call to **binlog.commit**.
+Example
+ ::
+ binlog.start();
+
+$Function VOID pack(PRIV_VCL, STRING)
+
+Description
+ Pack next data item into the binary log record. The item is
+ converted according to the second argument of **binlog.init**.
+ The conversion specifier is selected using the ordinal number
+ of this **pack** call after the latest **binlog.start**.
+
+$Function VOID commit(PRIV_VCL)
+
+Description
+ Finalize the binary log record and commit it. Any uninitialized
+ fields will be set to 0.
+
+Example
+ ::
+
+ binlog.start();
+ binlog.pack(http.X-Id);
+ binlog.pack(http.req.url);
+ binlog.pack(http.X-Node);
+ binlog.commit();
+
+$Function VOID sync(PRIV_VCL)
+
+Description
+ Synchronize the binary log with the disk file.
+
+$Function VOID close(PRIV_VCL)
+
+Description
+ Close the log. This is supposed to be called from **vcl_fini**.
+
+SEE ALSO
+========
+
+* binlogcat(1)
+* binlogsel(1)
+* vcl(7)
+* varnishd(1)

Return to:

Send suggestions and report system problems to the System administrator.