summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-03-23 15:40:57 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-03-23 15:40:57 (GMT)
commit1ddd47d953e959358846e5051aacc5aad17e89d9 (patch) (side-by-side diff)
treede6d7a43cc8dece3cf54dc3a9025572380c3d73f
parent51dabbd7c63995b58168f5dc486b31842c7db9c4 (diff)
downloadvmod-tbf-1ddd47d953e959358846e5051aacc5aad17e89d9.tar.gz
vmod-tbf-1ddd47d953e959358846e5051aacc5aad17e89d9.tar.bz2
Works with Varnish 6.3.2. Restore backward compatibility with <6.2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--configure.ac2
-rw-r--r--src/getla.c4
-rw-r--r--src/tbf.c2
-rw-r--r--src/tbf.h7
4 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 36870ee..f296b3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,7 @@ AC_CHECK_HEADERS(sys/sysinfo.h)
# Check for functions
AC_CHECK_FUNCS(sysinfo getloadavg)
-AM_VARNISHAPI([4.1],[6.3.1])
+AM_VARNISHAPI([4.1],[6.3.2])
AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR],
[Varnish API major version number])
diff --git a/src/getla.c b/src/getla.c
index 473cd01..ce4095c 100644
--- a/src/getla.c
+++ b/src/getla.c
@@ -1,5 +1,5 @@
/* This file is part of vmod-tbf
- Copyright (C) 2013-2017 Sergey Poznyakoff
+ Copyright (C) 2013-2020 Sergey Poznyakoff
Vmod-tbf is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
*/
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include "tbf.h"
#if defined(HAVE_SYSINFO) && defined(HAVE_SYS_SYSINFO_H)
# include <sys/sysinfo.h>
diff --git a/src/tbf.c b/src/tbf.c
index f1d0878..097f15a 100644
--- a/src/tbf.c
+++ b/src/tbf.c
@@ -846,7 +846,7 @@ tbf_exit(void)
}
int
-vmod_tbf_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
+VEVENT(tbf_event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
{
switch (e) {
case VCL_EVENT_LOAD:
diff --git a/src/tbf.h b/src/tbf.h
index a138eeb..1a851c7 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -39,6 +39,13 @@
#endif
#define WSPTR(s) ((s)->ws)
+#ifdef VPFX
+# define VEVENT(a) VPFX(a)
+#else
+/* For compatibility with varnish prior to 6.2 */
+# define VEVENT(a) a
+#endif
+
#ifndef USEC_PER_SEC
# define USEC_PER_SEC 1000000L
#endif

Return to:

Send suggestions and report system problems to the System administrator.