aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-03-23 17:40:57 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-03-23 17:40:57 +0200
commit1ddd47d953e959358846e5051aacc5aad17e89d9 (patch)
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
-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)
46# Check for functions 46# Check for functions
47AC_CHECK_FUNCS(sysinfo getloadavg) 47AC_CHECK_FUNCS(sysinfo getloadavg)
48 48
49AM_VARNISHAPI([4.1],[6.3.1]) 49AM_VARNISHAPI([4.1],[6.3.2])
50AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], 50AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR],
51 [Varnish API major version number]) 51 [Varnish API major version number])
52 52
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 @@
1/* This file is part of vmod-tbf 1/* This file is part of vmod-tbf
2 Copyright (C) 2013-2017 Sergey Poznyakoff 2 Copyright (C) 2013-2020 Sergey Poznyakoff
3 3
4 Vmod-tbf is free software; you can redistribute it and/or modify 4 Vmod-tbf is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. 15 along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#define _BSD_SOURCE 17#define _DEFAULT_SOURCE
18#include "tbf.h" 18#include "tbf.h"
19#if defined(HAVE_SYSINFO) && defined(HAVE_SYS_SYSINFO_H) 19#if defined(HAVE_SYSINFO) && defined(HAVE_SYS_SYSINFO_H)
20# include <sys/sysinfo.h> 20# 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)
846} 846}
847 847
848int 848int
849vmod_tbf_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) 849VEVENT(tbf_event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
850{ 850{
851 switch (e) { 851 switch (e) {
852 case VCL_EVENT_LOAD: 852 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 @@
39#endif 39#endif
40#define WSPTR(s) ((s)->ws) 40#define WSPTR(s) ((s)->ws)
41 41
42#ifdef VPFX
43# define VEVENT(a) VPFX(a)
44#else
45/* For compatibility with varnish prior to 6.2 */
46# define VEVENT(a) a
47#endif
48
42#ifndef USEC_PER_SEC 49#ifndef USEC_PER_SEC
43# define USEC_PER_SEC 1000000L 50# define USEC_PER_SEC 1000000L
44#endif 51#endif

Return to:

Send suggestions and report system problems to the System administrator.