aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-03-23 17:52:55 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-03-23 17:52:55 +0200
commit0166a0ec575e9e4d65719a94aef99427c2b05263 (patch)
tree97a7dcaa77ee2e9892f583d2f59856eb011b18d1
parent38fc232e63ae65a064b6bb838dccb2b3d9c3e5d2 (diff)
downloadvmod-geoip-0166a0ec575e9e4d65719a94aef99427c2b05263.tar.gz
vmod-geoip-0166a0ec575e9e4d65719a94aef99427c2b05263.tar.bz2
Works with Varnish 6.3.2. Restore backward compatibility with <6.2
-rw-r--r--configure.ac2
-rw-r--r--src/vmod_geoip.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 903f270..a3ef08a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@ AC_PROG_MAKE_SET
42AC_HEADER_STDC 42AC_HEADER_STDC
43AC_CHECK_HEADERS([sys/stdlib.h]) 43AC_CHECK_HEADERS([sys/stdlib.h])
44 44
45AM_VARNISHAPI([5.1], [6.3.1]) 45AM_VARNISHAPI([5.1], [6.3.2])
46AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], 46AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR],
47 [Varnish API major version number]) 47 [Varnish API major version number])
48 48
diff --git a/src/vmod_geoip.c b/src/vmod_geoip.c
index 47729fa..de26eea 100644
--- a/src/vmod_geoip.c
+++ b/src/vmod_geoip.c
@@ -19,6 +19,14 @@
19# include <vcc_if.h> 19# include <vcc_if.h>
20# include <cache/cache.h> 20# include <cache/cache.h>
21#endif 21#endif
22
23#ifdef VPFX
24# define VEVENT(a) VPFX(a)
25#else
26/* For compatibility with varnish prior to 6.2 */
27# define VEVENT(a) a
28#endif
29
22#include <vtcp.h> 30#include <vtcp.h>
23#include <vsa.h> 31#include <vsa.h>
24 32
@@ -41,7 +49,7 @@ free_conf(void *data)
41} 49}
42 50
43int 51int
44vmod_geoip_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) 52VEVENT(geoip_event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
45{ 53{
46 if (e == VCL_EVENT_LOAD) { 54 if (e == VCL_EVENT_LOAD) {
47 struct geoip_config *conf = calloc(1, sizeof(*conf)); 55 struct geoip_config *conf = calloc(1, sizeof(*conf));

Return to:

Send suggestions and report system problems to the System administrator.