summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-03-23 15:52:55 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-03-23 15:52:55 (GMT)
commit0166a0ec575e9e4d65719a94aef99427c2b05263 (patch) (side-by-side diff)
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
Diffstat (more/less context) (ignore whitespace changes)
-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
AC_HEADER_STDC
AC_CHECK_HEADERS([sys/stdlib.h])
-AM_VARNISHAPI([5.1], [6.3.1])
+AM_VARNISHAPI([5.1], [6.3.2])
AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR],
[Varnish API major version number])
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 @@
# include <vcc_if.h>
# include <cache/cache.h>
#endif
+
+#ifdef VPFX
+# define VEVENT(a) VPFX(a)
+#else
+/* For compatibility with varnish prior to 6.2 */
+# define VEVENT(a) a
+#endif
+
#include <vtcp.h>
#include <vsa.h>
@@ -41,7 +49,7 @@ free_conf(void *data)
}
int
-vmod_geoip_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
+VEVENT(geoip_event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
{
if (e == VCL_EVENT_LOAD) {
struct geoip_config *conf = calloc(1, sizeof(*conf));

Return to:

Send suggestions and report system problems to the System administrator.