diff options
-rw-r--r-- | NEWS | 5 | ||||
m--------- | acvmod | 0 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/vmod_geoip.c | 46 |
4 files changed, 38 insertions, 19 deletions
@@ -1,2 +1,2 @@ -Vmod-geoip NEWS -- history of user-visible changes. 2020-03-27 +Vmod-geoip NEWS -- history of user-visible changes. 2022-08-21 See the end of file for copying conditions. @@ -5,4 +5,5 @@ Please send Vmod-geoip bug reports to <gray@gnu.org> -Version 1.1.90 (git) +Version 1.2, 2022-08-21 +* Support for Varnish 7.1 * Drop support for Varnish versions prior to 6.0.0 diff --git a/acvmod b/acvmod -Subproject 82d8dc6b0c0f316acb7f9b4f351fbd8cb1f85e9 +Subproject 0516e2461e8f2e3b33a7fffa13705cdb1de77c5 diff --git a/configure.ac b/configure.ac index 06538a2..ae94346 100644 --- a/configure.ac +++ b/configure.ac @@ -1,3 +1,3 @@ # This file is part of vmod-geoip -*- autoconf -*- -# Copyright (C) 2017-2020 Sergey Poznyakoff +# Copyright (C) 2017-2022 Sergey Poznyakoff # @@ -16,3 +16,3 @@ AC_PREREQ(2.69) -AC_INIT([vmod-geoip], 1.1.90, [gray@gnu.org]) +AC_INIT([vmod-geoip], 1.2, [gray@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) @@ -44,3 +44,3 @@ AC_CHECK_HEADERS([sys/stdlib.h]) -AM_VARNISHAPI([6.0.0], [6.3.2]) +AM_VARNISHAPI([6.0.0], [7.1.0]) AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], diff --git a/src/vmod_geoip.c b/src/vmod_geoip.c index d704915..8af0ba8 100644 --- a/src/vmod_geoip.c +++ b/src/vmod_geoip.c @@ -36,2 +36,15 @@ struct geoip_config { +#if (VARNISHAPI_MAJOR == 6 && VARNISHAPI_MINOR >= 6) || VARNISHAPI_MAJOR > 6 +static void +free_conf(VRT_CTX, void *data) +{ + free(data); +} + +static const struct vmod_priv_methods free_conf_methods[1] = {{ + .magic = VMOD_PRIV_METHODS_MAGIC, + .type = "vmod_geoip", + .fini = free_conf +}}; +#else static void @@ -42,2 +55,3 @@ free_conf(void *data) } +#endif @@ -50,3 +64,7 @@ VEVENT(geoip_event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) priv->priv = conf; +#if (VARNISHAPI_MAJOR == 6 && VARNISHAPI_MINOR >= 6) || VARNISHAPI_MAJOR > 6 + priv->methods = free_conf_methods; +#else priv->free = free_conf; +#endif } @@ -109,3 +127,3 @@ open_geoip_database(VRT_CTX, struct geoip_config *conf, MMDB_s *dbptr) -static char * +static const char * conv_utf_string (struct ws *ws, MMDB_entry_data_s *dptr) @@ -119,3 +137,3 @@ conv_utf_string (struct ws *ws, MMDB_entry_data_s *dptr) -static char * +static const char * conv_uint16(struct ws *ws, MMDB_entry_data_s *dptr) @@ -125,3 +143,3 @@ conv_uint16(struct ws *ws, MMDB_entry_data_s *dptr) -static char * +static const char * conv_uint32(struct ws *ws, MMDB_entry_data_s *dptr) @@ -131,3 +149,3 @@ conv_uint32(struct ws *ws, MMDB_entry_data_s *dptr) -static char * +static const char * conv_int32(struct ws *ws, MMDB_entry_data_s *dptr) @@ -137,3 +155,3 @@ conv_int32(struct ws *ws, MMDB_entry_data_s *dptr) -static char * +static const char * conv_bool(struct ws *ws, MMDB_entry_data_s *dptr) @@ -143,3 +161,3 @@ conv_bool(struct ws *ws, MMDB_entry_data_s *dptr) -static char * +static const char * conv_double(struct ws *ws, MMDB_entry_data_s *dptr) @@ -149,3 +167,3 @@ conv_double(struct ws *ws, MMDB_entry_data_s *dptr) -static char * +static const char * conv_float(struct ws *ws, MMDB_entry_data_s *dptr) @@ -155,3 +173,3 @@ conv_float(struct ws *ws, MMDB_entry_data_s *dptr) -static char *(*entry_conv[]) (struct ws *, MMDB_entry_data_s *) = { +static const char *(*entry_conv[]) (struct ws *, MMDB_entry_data_s *) = { [MMDB_DATA_TYPE_UTF8_STRING] = conv_utf_string, @@ -165,3 +183,3 @@ static char *(*entry_conv[]) (struct ws *, MMDB_entry_data_s *) = { -static char * +static const char * lookup_geoip_database(VRT_CTX, @@ -174,3 +192,3 @@ lookup_geoip_database(VRT_CTX, MMDB_entry_data_s entry_data; - char *retval; + const char *retval; const struct sockaddr *sa; @@ -257,3 +275,3 @@ vmod_get(VRT_CTX, struct vmod_priv *priv, VCL_IP ip, VCL_STRING path) MMDB_s dbfile; - char *retval = NULL; + const char *retval = NULL; char **pathv; @@ -274,3 +292,3 @@ vmod_country_code(VRT_CTX, struct vmod_priv *priv, VCL_IP ip) MMDB_s dbfile; - char *retval = NULL; + char const *retval = NULL; static char *country_code_path[] = { @@ -294,3 +312,3 @@ vmod_country_name(VRT_CTX, struct vmod_priv *priv, VCL_IP ip) MMDB_s dbfile; - char *retval = NULL; + const char *retval = NULL; static char *country_name_path[] = { @@ -316,3 +334,3 @@ vmod_city_name(VRT_CTX, struct vmod_priv *priv, VCL_IP ip) MMDB_s dbfile; - char *retval = NULL; + const char *retval = NULL; static char *city_name_path[] = { |