diff options
-rw-r--r-- | NEWS | 19 | ||||
-rw-r--r-- | README | 16 | ||||
m--------- | acvmod | 0 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | src/variable.c | 39 | ||||
-rw-r--r-- | src/variable.vcc | 4 | ||||
-rw-r--r-- | src/vmod-variable.3 | 8 |
7 files changed, 74 insertions, 20 deletions
@@ -1,12 +1,25 @@ -vmod-variable -- history of user-visible changes. 2017-08-10 -Copyright (C) 2015-2017 Sergey Poznyakoff +vmod-variable -- history of user-visible changes. 2022-08-21 See the end of file for copying conditions. Please send vmod-variable bug reports to <gray@gnu.org> +Version 1.5, 2022-08-21 + +* Support for Varnish 7.1 + + +Version 1.4, 2020-04-09 + +* Drop support for Varnish versions prior to 6.0.0. + + +Version 1.3, 2018-12-10 + +* Support for Varnish 6.0.2 + Version 1.2, 2017-08-10 * Support for Varnish 5.1 Version 1.1, 2017-08-06 @@ -23,13 +36,13 @@ Version 1.0, 2015-02-16 Initial release ========================================================================= Copyright information: -Copyright (C) 2015-2017 Sergey Poznyakoff +Copyright (C) 2015-2018 Sergey Poznyakoff Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. @@ -1,8 +1,7 @@ Vmod-variable README -Copyright (C) 2015 Sergey Poznyakoff See the end of file for copying conditions. * Introduction This file contains brief information about configuring, testing and using vmod-variable. It is *not* intended as a replacement @@ -13,13 +12,13 @@ For accessing complete vmod-variable documentation, see the section For a list of differences between this module and vmod_var, see the section "vmod_variable vs. vmod_var". * Overview This module provides enhanced variable support for VCL scripts. -It compiles for Varnish versions 3 and 4. +It compiles for Varnish versions 6.0.0 - 6.4.0. There are two kinds of variables: session-specific, which have the lifespan of one HTTP session (connection) and cease to exist when it is closed, and global, which are shared between all sessions. Session-specific variables are typed, a pair of functions is provided @@ -216,13 +215,26 @@ install. To read it without actually installing the module, run An online copy of the documentation is available from http://www.gnu.org.ua/software/vmod-variable. * Bug reporting Send bug reports and suggestions to <gray@gnu.org> + +* Copyright information: + +Copyright (C) 2013-2018 Sergey Poznyakoff + + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and this permission notice are preserved, + thus giving the recipient permission to redistribute in turn. + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last changed them. Local Variables: mode: outline paragraph-separate: "[ ]*$" version-control: never End: diff --git a/acvmod b/acvmod -Subproject 5f6dce2f7dd35a154333bb42d134a018b981f81 +Subproject 0516e2461e8f2e3b33a7fffa13705cdb1de77c5 diff --git a/configure.ac b/configure.ac index e80461a..f573452 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ # This file is part of vmod-variable -*- autoconf -*- -# Copyright (C) 2015-2017 Sergey Poznyakoff +# Copyright (C) 2015-2022 Sergey Poznyakoff # # Vmod-variable 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. # @@ -11,13 +11,13 @@ # 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-variable. If not, see <http://www.gnu.org/licenses/>. AC_PREREQ(2.69) -AC_INIT([vmod-variable], [1.2], [gray@gnu.org]) +AC_INIT([vmod-variable], [1.5], [gray@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(src/variable.vcc) AM_CONFIG_HEADER(config.h) AC_SUBST([AC_VMOD_BASENAME],[variable]) @@ -47,13 +47,15 @@ AC_CHECK_HEADERS(pcre.h,, # Check for functions AC_CHECK_FUNCS(sysinfo getloadavg) AC_CHECK_LIB(pcre, pcre_compile,, AC_MSG_ERROR([required library libpcre not found])) -AM_VARNISHAPI([4.1],[5.1]) +AM_VARNISHAPI([6.0.0],[7.1.0]) +AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], + [Varnish API major version number]) AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/Makefile tests/atlocal]) AM_MISSING_PROG([AUTOM4TE], [autom4te]) AC_CONFIG_FILES([ diff --git a/src/variable.c b/src/variable.c index feaaa21..05aa13b 100644 --- a/src/variable.c +++ b/src/variable.c @@ -1,8 +1,8 @@ /* This file is part of vmod-variable - Copyright (C) 2013-2017 Sergey Poznyakoff + Copyright (C) 2013-2018 Sergey Poznyakoff Vmod-variable 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. @@ -16,19 +16,27 @@ */ #include <config.h> #include <stdlib.h> #include <stdarg.h> #include <syslog.h> #include <errno.h> +#include <string.h> #include <ctype.h> #include <pcre.h> -#include "vrt.h" -#include "vcc_if.h" -#include "pthread.h" -#include "cache/cache.h" - +#include <pthread.h> +#include <limits.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) /* |hash_size| defines a sequence of symbol table sizes. These are prime numbers, each of which is approximately twice its predecessor. */ static unsigned int hash_size[] = { @@ -367,24 +375,43 @@ vmod_global_unset(VRT_CTX, VCL_STRING name) { AZ(pthread_mutex_lock(&global_mtx)); symtab_remove(global_symtab, name); AZ(pthread_mutex_unlock(&global_mtx)); } +#if (VARNISHAPI_MAJOR == 6 && VARNISHAPI_MINOR >= 6) || VARNISHAPI_MAJOR > 6 +static void +fini_priv_data(VRT_CTX, void *p) +{ + symtab_free(p); +} + +static const struct vmod_priv_methods free_priv_data_methods[1] = {{ + .magic = VMOD_PRIV_METHODS_MAGIC, + .type = "vmod_variable", + .fini = fini_priv_data +}}; +#else static void priv_symtab_free(void *p) { symtab_free(p); } +#endif + static struct symtab * get_symtab(struct vmod_priv *priv) { if (!priv->priv) { priv->priv = symtab_create(); +#if (VARNISHAPI_MAJOR == 6 && VARNISHAPI_MINOR >= 6) || VARNISHAPI_MAJOR > 6 + priv->methods = free_priv_data_methods; +#else priv->free = priv_symtab_free; +#endif } return priv->priv; } #define getvar(vt, name) symtab_lookup_or_install(vt, name, NULL) diff --git a/src/variable.vcc b/src/variable.vcc index c309218..7cf27ff 100644 --- a/src/variable.vcc +++ b/src/variable.vcc @@ -1,8 +1,8 @@ # This file is part of vmod-variable -# Copyright (C) 2015-2017 Sergey Poznyakoff +# Copyright (C) 2015-2020 Sergey Poznyakoff # # Vmod-variable 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. # @@ -11,13 +11,13 @@ # 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-variable. If not, see <http://www.gnu.org/licenses/>. -$Module variable 3 Variable Support for Varnish +$Module variable 3 "Enhanced Variable Support for Varnish" COLOPHON ======== Due to limitations of the vmodtool.py utility, this document contains only prototypes of the functions provided by the **vmod-variable** module. For a detailed documentation, please see vmod-variable(3) manual page. diff --git a/src/vmod-variable.3 b/src/vmod-variable.3 index f249ad3..8e7d8df 100644 --- a/src/vmod-variable.3 +++ b/src/vmod-variable.3 @@ -1,8 +1,8 @@ .\" This file is part of Vmod-variable -*- nroff -*- -.\" Copyright (C) 2015 Sergey Poznyakoff +.\" Copyright (C) 2015-2022 Sergey Poznyakoff .\" .\" Vmod-variable 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. .\" @@ -10,13 +10,13 @@ .\" 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-variable. If not, see <http://www.gnu.org/licenses/>. -.TH VMOD-VARIABLE 1 "February 16, 2015" "VMOD-VARIABLE" "User Reference" +.TH VMOD-VARIABLE 3 "August 21, 2022" "VMOD-VARIABLE" "User Reference" .SH NAME vmod-variable \- variable support for Varnish Cache .SH SYNOPSIS \fBimport variable\fR [\fIPATH\fR]\fB;\fR @@ -218,24 +218,24 @@ if (req.request == "GET") { .\" .\" The MANCGI variable is set by man.cgi script on Ulysses. .\" The download.inc file contains the default DOWNLOAD section .\" for man-based doc pages. .if "\V[MANCGI]"WEBDOC" \{\ . ds package vmod-variable -. ds version 1.0 +. ds version 1.5 . so download.inc \} .SH "SEE ALSO" .BR vcl (7), .BR varnishd (1). .SH AUTHORS Sergey Poznyakoff .SH "BUG REPORTS" Report bugs to <gray@gnu.org>. .SH COPYRIGHT -Copyright \(co 2015 Sergey Poznyakoff +Copyright \(co 2015-2022 Sergey Poznyakoff .br .na License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> .br .ad This is free software: you are free to change and redistribute it. |