Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2021 18:35:18 GMT
From:      Ryan Steinmetz <zi@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 1c02da232c04 - main - www/varnish-ip2proxy: Update varnish 6.6 compatibility, bump PORTREVISION
Message-ID:  <202105131835.14DIZIbk075407@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by zi:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1c02da232c04aa7539e93d2bc67600cec8d5697e

commit 1c02da232c04aa7539e93d2bc67600cec8d5697e
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2021-05-13 18:33:13 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2021-05-13 18:35:06 +0000

    www/varnish-ip2proxy: Update varnish 6.6 compatibility, bump PORTREVISION
---
 www/varnish-ip2proxy/Makefile                      |   1 +
 .../patch-6d806f29bde9a5b0d92455f182cf67c80592cb47 |  24 ----
 ...e97bc592fdd9e60c => patch-src_vmod__ip2proxy.c} | 146 +++++----------------
 3 files changed, 34 insertions(+), 137 deletions(-)

diff --git a/www/varnish-ip2proxy/Makefile b/www/varnish-ip2proxy/Makefile
index d1d70e9ef7f3..002d1256b501 100644
--- a/www/varnish-ip2proxy/Makefile
+++ b/www/varnish-ip2proxy/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	ip2proxy
 PORTVERSION=	1.2.0
+PORTREVISION=	1
 CATEGORIES=	www
 PKGNAMEPREFIX=	varnish-
 
diff --git a/www/varnish-ip2proxy/files/patch-6d806f29bde9a5b0d92455f182cf67c80592cb47 b/www/varnish-ip2proxy/files/patch-6d806f29bde9a5b0d92455f182cf67c80592cb47
deleted file mode 100644
index c88988305c96..000000000000
--- a/www/varnish-ip2proxy/files/patch-6d806f29bde9a5b0d92455f182cf67c80592cb47
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/README.rst b/README.rst
-index 3753102..4fc1a57 100644
---- README.rst
-+++ README.rst
-@@ -4,7 +4,7 @@ IP2Proxy Varnish Module
- 
- :Author: IP2Location
- :Date: 202--11-26
--:Version: 1.2.0
-+:Version: 1.2.1
- :Manual section: 3
- 
- An Varnish module that enables the user to find the country, region,
-diff --git a/configure.ac b/configure.ac
-index 9ec9497..4b40cea 100644
---- configure.ac
-+++ configure.ac
-@@ -1,5 +1,5 @@
- AC_PREREQ(2.64)
--AC_INIT([libvmod-ip2proxy], [1.2.0], [support@ip2location.com], [libvmod-ip2proxy])
-+AC_INIT([libvmod-ip2proxy], [1.2.1], [support@ip2location.com], [libvmod-ip2proxy])
- AC_CONFIG_MACRO_DIR([m4])
- AC_CONFIG_SRCDIR(src/vmod_ip2proxy.vcc)
- AM_CONFIG_HEADER(config.h)
diff --git a/www/varnish-ip2proxy/files/patch-193f65f7a2ceff2dff1462a8e97bc592fdd9e60c b/www/varnish-ip2proxy/files/patch-src_vmod__ip2proxy.c
similarity index 74%
rename from www/varnish-ip2proxy/files/patch-193f65f7a2ceff2dff1462a8e97bc592fdd9e60c
rename to www/varnish-ip2proxy/files/patch-src_vmod__ip2proxy.c
index 04e910eadba1..170876622b4d 100644
--- a/www/varnish-ip2proxy/files/patch-193f65f7a2ceff2dff1462a8e97bc592fdd9e60c
+++ b/www/varnish-ip2proxy/files/patch-src_vmod__ip2proxy.c
@@ -1,81 +1,6 @@
-diff --git a/README.rst b/README.rst
-index abe2e2c..3753102 100644
---- README.rst
-+++ README.rst
-@@ -3,7 +3,7 @@ IP2Proxy Varnish Module
- ---------------------------
- 
- :Author: IP2Location
--:Date: 2020-11-24
-+:Date: 202--11-26
- :Version: 1.2.0
- :Manual section: 3
- 
-diff --git a/readme.md b/readme.md
-index 4a4054d..f2fac33 100644
---- readme.md
-+++ readme.md
-@@ -191,8 +191,6 @@ set req.http.X-Usagetype = ip2proxy.as("client.ip");
- set req.http.X-Usagetype = ip2proxy.last_seen("client.ip");
- ```
- 
--
--
- ### threat
- 
- Return security threat reported for this IP.
-@@ -211,31 +209,33 @@ set req.http.X-Threat = ip2proxy.threat("client.ip");
- 
-    Answer: You can get free IP2Proxy LITE databases from [https://lite.ip2location.com](https://lite.ip2location.com/), or purchase an IP2Proxy commercial database from <https://www.ip2location.com/database/ip2proxy>.
- 
--2.  "I can't install the module. Please help me."
-+2. "I can't install the module. Please help me."
- 
-    Answer: Once again, before you install the package, please make sure that you have installed autoconf, libtool and make packages first. Those packages are necessary to compile and install this module.
- 
--3.  "Why am I getting an error message said that Package varnishapi was not found?"
-+3. "Why am I getting an error message said that Package varnishapi was not found?"
- 
-    Answer: In order to use Varnish vmod, you have to install varnishapi package before hand. Please refer to the [Installation](#installation) section first before install this module. 
--   
-+
-  4. "I am getting error message said that You need rst2man installed to make dist. What should I do?"
- 
--​       Answer: If you encounter such message, you can install rst2man by installing python-docutils package than provide rst2man:
-+    Answer: If you encounter such message, you can install rst2man by installing python-docutils package than provide rst2man: 
- 
--```bash
--apt-get install python-docutils
--```
-+    ```
-+    apt-get install python-docutils
-+    ```
- 
-  5. "I am getting Permission denied when running autogen.sh.. What should I do?"
- 
--​       Answer: You can try to edit the permission for autogen.sh by:
-+    Answer: You can try to edit the permission for autogen.sh by:
- 
--```bash
--chmod +x autogen.sh
--```
-+    ```
-+    chmod +x autogen.sh
-+    ```
-+
-+    
- 
- # Support
- 
- Email: [support@ip2location.com](mailto:support@ip2location.com).
--URL: [https://www.ip2location.com](https://www.ip2location.com/)
-+URL: [https://www.ip2location.com](https://www.ip2location.com/)
-\ No newline at end of file
-diff --git a/src/vmod_ip2proxy.c b/src/vmod_ip2proxy.c
-index bb87e82..1960a6f 100644
---- src/vmod_ip2proxy.c
+--- src/vmod_ip2proxy.c.orig	2020-11-23 23:20:35 UTC
 +++ src/vmod_ip2proxy.c
-@@ -1,268 +1,102 @@
+@@ -1,268 +1,109 @@
 +/*
 + * IP2Proxy Varnish library is distributed under LGPL version 3
 + * Copyright (c) 2013-2020 IP2Proxy.com. support at ip2location dot com
@@ -149,16 +74,23 @@ index bb87e82..1960a6f 100644
 -void
 -ip2p_free(void *d)
 +static void
-+ip2proxy_free(void *ptr)
++ip2proxy_free(VRT_CTX, void *ptr)
  {
 -	ip2proxy_data_t *data = d;
 -
 -	if (data->ip2p_handle != NULL) {
 -		IP2Proxy_close(data->ip2p_handle);
 -	}
++	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 +	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
 -VPFX(init_db)(VRT_CTX, struct VPFX(priv) *priv, char *filename, char *memtype)
 +vmod_init_db(VRT_CTX, struct vmod_priv *priv, char *filename, char *memtype)
@@ -177,9 +109,7 @@ index bb87e82..1960a6f 100644
 -		printf("IP2Proxy Database %s is loaded.\n", (char *) filename);
 -
 -		priv->priv = IP2ProxyObj;
-+	IP2Proxy *IP2ProxyObj;
-+	enum IP2Proxy_lookup_mode mtype;
- 
+-
 -		if (strcmp(memtype, "IP2PROXY_FILE_IO") == 0) {
 -			IP2Proxy_set_lookup_mode(priv->priv, IP2PROXY_FILE_IO);
 -		} else if (strcmp(memtype, "IP2PROXY_CACHE_MEMORY") == 0) {
@@ -192,7 +122,9 @@ index bb87e82..1960a6f 100644
 -		priv->free = ip2p_free;
 -	}
 -}
--
++	IP2Proxy *IP2ProxyObj;
++	enum IP2Proxy_lookup_mode mtype;
+ 
 -// Use this function to query result, and then extract the field based on user selection
 -void *
 -query_all(VRT_CTX, struct VPFX(priv) *priv, char * ip, int option)
@@ -204,7 +136,9 @@ index bb87e82..1960a6f 100644
 -	printf("The client IP is %s.\n", (char *) ip);
 -	
  	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
--
++	AN(priv);
++	AN(memtype);
+ 
 -	if (priv->priv != NULL) {
 -		handle = priv->priv;
 -		r = IP2Proxy_get_all(handle, (char *) ip);
@@ -259,9 +193,6 @@ index bb87e82..1960a6f 100644
 -
 -			return (result);
 -		}
-+	AN(priv);
-+	AN(memtype);
-+
 +	if (strcmp(memtype, "IP2PROXY_FILE_IO") == 0)
 +		mtype = IP2PROXY_FILE_IO;
 +	else if (strcmp(memtype, "IP2PROXY_SHARED_MEMORY") == 0)
@@ -277,9 +208,7 @@ index bb87e82..1960a6f 100644
 -
 -	return WS_Copy(ctx->ws, "????", -1);
 -}
-+	if (priv->priv != NULL)
-+		IP2Proxy_close((IP2Proxy *)priv->priv);
- 
+-
 -VCL_STRING
 -VPFX(country_short)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
 -{
@@ -351,6 +280,16 @@ index bb87e82..1960a6f 100644
 -	result = query_all(ctx, priv, ip, query_ASN);
 -	return (result);
 -}
++	if (priv->priv != NULL)
++		IP2Proxy_close((IP2Proxy *)priv->priv);
+ 
+-VCL_STRING
+-VPFX(as)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
+-{
+-	const char *result = NULL;
+-	result = query_all(ctx, priv, ip, query_AS);
+-	return (result);
+-}
 +	IP2ProxyObj = IP2Proxy_open(filename);
 +	if (!IP2ProxyObj) {
 +		VRT_fail(ctx, "IP2Proxy: can't open database (%s)", filename);
@@ -359,20 +298,20 @@ index bb87e82..1960a6f 100644
 +	IP2Proxy_open_mem(IP2ProxyObj, mtype);
  
 -VCL_STRING
--VPFX(as)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
+-VPFX(last_seen)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
 -{
 -	const char *result = NULL;
--	result = query_all(ctx, priv, ip, query_AS);
+-	result = query_all(ctx, priv, ip, query_LASTSEEN);
 -	return (result);
 +	priv->priv = IP2ProxyObj;
-+	priv->free = ip2proxy_free;
++	priv->methods = ip2p_methods;
  }
  
 -VCL_STRING
--VPFX(last_seen)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
+-VPFX(is_proxy)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
 -{
 -	const char *result = NULL;
--	result = query_all(ctx, priv, ip, query_LASTSEEN);
+-	result = query_all(ctx, priv, ip, query_ISPROXY);
 -	return (result);
 +#define FUNC(lower, field)					\
 +VCL_STRING							\
@@ -397,14 +336,6 @@ index bb87e82..1960a6f 100644
 +	return (result);					\
  }
  
--VCL_STRING
--VPFX(is_proxy)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
--{
--	const char *result = NULL;
--	result = query_all(ctx, priv, ip, query_ISPROXY);
--	return (result);
--}
--
 -VCL_STRING
 -VPFX(threat)(VRT_CTX, struct VPFX(priv) *priv, char * ip)
 -{
@@ -426,14 +357,3 @@ index bb87e82..1960a6f 100644
 +FUNC(last_seen,      last_seen)
 +FUNC(is_proxy,       is_proxy)
 +FUNC(threat,         threat)
-diff --git a/src/vmod_ip2proxy.vcc b/src/vmod_ip2proxy.vcc
-index 85558a5..71e6c71 100644
---- src/vmod_ip2proxy.vcc
-+++ src/vmod_ip2proxy.vcc
-@@ -28,4 +28,4 @@ $Function STRING last_seen(PRIV_VCL, STRING)
- 
- $Function STRING is_proxy(PRIV_VCL, STRING)
- 
--$Function STRING threat(PRIV_VCL, STRING)
-\ No newline at end of file
-+$Function STRING threat(PRIV_VCL, STRING)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105131835.14DIZIbk075407>