diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-03-26 16:16:44 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-03-26 16:16:44 +0200 |
commit | 9348dbda0b0a0471749092632e2675a648ca9e54 (patch) | |
tree | d58d9ecb47c7bb7f36a177488f85f1079c000cfb | |
parent | ee278a1f44a6f12eddbe11f159f17485a616af98 (diff) | |
download | vmod-binlog-9348dbda0b0a0471749092632e2675a648ca9e54.tar.gz vmod-binlog-9348dbda0b0a0471749092632e2675a648ca9e54.tar.bz2 |
Dropped support for varnish < 6.0
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | README | 2 | ||||
m--------- | acvmod | 0 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/binlog.c | 23 |
5 files changed, 17 insertions, 19 deletions
@@ -1,17 +1,22 @@ -Vmod-binlog NEWS -- history of user-visible changes. 2020-03-10 +Vmod-binlog NEWS -- history of user-visible changes. 2020-03-26 See the end of file for copying conditions. Please send Vmod-binlog bug reports to <gray@gnu.org> +Version 2.5.90 (git) + +* Dropped support for Varnish versions prior to 6.0 + + Version 2.5, 2020-03-10 * Restore backward compatibility with Varnish versions prior to 6.2. Version 2.4, 2020-03-03 * Support for Varnish 6.3.1 Version 2.3, 2018-12-10 * Support for Varnish 6.0.2 @@ -13,25 +13,25 @@ For accessing complete vmod-binlog documentation, see the section Vmod-binlog is a module for Varnish Cache. It provides support for writing binary log files from VCL scripts. A binary log file consists of an arbitrary number of equally sized records. Each record contains a UNIX timestamp in binary form and arbitrary user-defined data. Such files are convenient for storing big amounts of information arriving at high rates. The package provides the module itself and the utilities for listing and searching in binary log files. -The module was tested with Varnish versions 4.1 through 6.0.2. +The module was tested with Varnish versions 6.0.2 through 6.3.2. * Installation In order to compile the package you need to have the varnishd and varnishapi packages installed. Supposing that condition is met, run: ./configure It should be able to automatically find the necessary components. In case it doesn't, tweak the configuration variables as necessary. The most diff --git a/acvmod b/acvmod -Subproject 5b214e3d72f9e261a37cf31deb41e7f8a61a181 +Subproject b68d558d7aef78eca1417e59ebb0ae38c276e9e diff --git a/configure.ac b/configure.ac index 0c91590..6f28517 100644 --- a/configure.ac +++ b/configure.ac @@ -5,25 +5,25 @@ # 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/>. AC_PREREQ(2.69) -AC_INIT([vmod-binlog], 2.5, [gray@gnu.org]) +AC_INIT([vmod-binlog], 2.5.90, [gray@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(src/binlog.c) AM_CONFIG_HEADER(config.h) AC_SUBST([AC_VMOD_BASENAME],[binlog]) AC_CANONICAL_SYSTEM AC_LANG(C) AM_INIT_AUTOMAKE([1.14 gnu tar-ustar subdir-objects silent-rules]) AM_SILENT_RULES([yes]) @@ -43,25 +43,25 @@ AC_PROG_MAKE_SET LT_PREREQ(2.2.5a) LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen]) LTDL_INIT([recursive]) AC_CONFIG_FILES([libltdl/Makefile]) AC_SYS_LARGEFILE # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/stdlib.h]) -AM_VARNISHAPI([4.1],[6.3.2]) +AM_VARNISHAPI([6.0],[6.3.2]) AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], [Varnish API major version number]) AC_SUBST(BINLOGSEL_MODDIR,'$(libdir)/$(PACKAGE)') # Initialize the test suite. AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/Makefile tests/atlocal]) AM_MISSING_PROG([AUTOM4TE], [autom4te]) AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/src/binlog.c b/src/binlog.c index 512503d..196c3c1 100644 --- a/src/binlog.c +++ b/src/binlog.c @@ -19,35 +19,28 @@ #include <sys/stat.h> #include <sys/mman.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <syslog.h> #include <stddef.h> #include <stdlib.h> #include <stdarg.h> #include <ctype.h> #include <time.h> #include <string.h> -#if VARNISHAPI_MAJOR > 5 -# include "cache/cache.h" -# include "vcl.h" -# include "vcc_if.h" -#else -# include "vcl.h" -# include "vrt.h" -# include "vcc_if.h" -# include "cache/cache.h" -#endif -#define WSPTR(s) ((s)->ws) + +#include <cache/cache.h> +#include <vcl.h> +#include <vcc_if.h> #ifdef VPFX # define VEVENT(a) VPFX(a) #else /* For compatibility with varnish prior to 6.2 */ # define VEVENT(a) a #endif #include "vmod-binlog.h" #include "pack.h" #include "pthread.h" @@ -445,34 +438,34 @@ vmod_init(VRT_CTX, struct vmod_priv *priv, pthread_mutex_init(&conf->mutex, NULL); } static char * mkfilename(VRT_CTX, struct binlog_config *conf) { time_t ts = time(NULL); size_t u, n; char *p, *q; if (conf->flags & BLF_ROUNDTS) ts -= ts % conf->interval; - u = WS_Reserve(WSPTR(ctx), 0); - p = WSPTR(ctx)->f; + u = WS_ReserveAll(ctx->ws); + p = ctx->ws->f; n = strftime(p, u, conf->pattern, gmtime(&ts)); if (n == 0) { - WS_Release(WSPTR(ctx), 0); + WS_Release(ctx->ws, 0); return NULL; } q = strdup(p); AN(q); - WS_Release(WSPTR(ctx), 0); + WS_Release(ctx->ws, 0); return q; } static int mkdir_p(struct binlog_config *conf, char *dir) { int rc = 0; char *p; struct stat st; for (p = dir; rc == 0 && *p; p++) { if (*p != '/') |