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
@@ -39,13 +39,13 @@ AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
# Checks for header files.
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])
PKG_CHECK_MODULES([MMDB], [libmaxminddb])
AC_CONFIG_FILES([
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
@@ -16,12 +16,20 @@
#else
# include <vcl.h>
# include <vrt.h>
# 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>
#include <maxminddb.h>
#include <assert.h>
@@ -38,13 +46,13 @@ free_conf(void *data)
{
struct geoip_config *cfg = data;
free(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));
AN(conf);
priv->priv = conf;
priv->free = free_conf;

Return to:

Send suggestions and report system problems to the System administrator.