diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-03-23 17:40:57 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-03-23 17:40:57 +0200 |
commit | 1ddd47d953e959358846e5051aacc5aad17e89d9 (patch) | |
tree | de6d7a43cc8dece3cf54dc3a9025572380c3d73f | |
parent | 51dabbd7c63995b58168f5dc486b31842c7db9c4 (diff) | |
download | vmod-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.ac | 2 | ||||
-rw-r--r-- | src/getla.c | 4 | ||||
-rw-r--r-- | src/tbf.c | 2 | ||||
-rw-r--r-- | src/tbf.h | 7 |
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 |
47 | AC_CHECK_FUNCS(sysinfo getloadavg) | 47 | AC_CHECK_FUNCS(sysinfo getloadavg) |
48 | 48 | ||
49 | AM_VARNISHAPI([4.1],[6.3.1]) | 49 | AM_VARNISHAPI([4.1],[6.3.2]) |
50 | AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], | 50 | AC_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> |
@@ -846,7 +846,7 @@ tbf_exit(void) | |||
846 | } | 846 | } |
847 | 847 | ||
848 | int | 848 | int |
849 | vmod_tbf_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) | 849 | VEVENT(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: |
@@ -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 |