From 1da04961140aa3feb8c3dbbf5095690461970948 Mon Sep 17 00:00:00 2001 From: Ryan Steinmetz Date: Fri, 14 May 2021 15:05:16 -0400 Subject: [PATCH] Update compatibility with varnish 6.6.x --- src/vmod_ip2proxy.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vmod_ip2proxy.c b/src/vmod_ip2proxy.c index 1960a6f..ea75683 100644 --- a/src/vmod_ip2proxy.c +++ b/src/vmod_ip2proxy.c @@ -24,11 +24,17 @@ #include "cache/cache.h" static void -ip2proxy_free(void *ptr) +ip2proxy_free(VRT_CTX, void *ptr) { IP2Proxy_close((IP2Proxy *)ptr); } +static const struct vmod_priv_methods ip2p_methods[1] = {{ + .magic = VMOD_PRIV_METHODS_MAGIC, + .type = "vmod_std_ip2proxy", + .fini = ip2proxy_free +}}; + VCL_VOID vmod_init_db(VRT_CTX, struct vmod_priv *priv, char *filename, char *memtype) { @@ -61,7 +67,7 @@ vmod_init_db(VRT_CTX, struct vmod_priv *priv, char *filename, char *memtype) IP2Proxy_open_mem(IP2ProxyObj, mtype); priv->priv = IP2ProxyObj; - priv->free = ip2proxy_free; + priv->methods = ip2p_methods; } #define FUNC(lower, field) \