[master] fb70da351 Change the ID of TCP pools from void * to uintmax_t.

Poul-Henning Kamp phk at FreeBSD.org
Thu Oct 3 09:06:07 UTC 2019


commit fb70da351bed1c9d3e51f688c3dc98b11e017ed5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Oct 3 09:05:03 2019 +0000

    Change the ID of TCP pools from void * to uintmax_t.

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index f1fd423e6..a3062176d 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -563,7 +563,7 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
 	AN(be->vsc);
 
 	be->tcp_pool = VTP_Ref(vrt->ipv4_suckaddr, vrt->ipv6_suckaddr,
-	    vrt->path, vbe_proto_ident);
+	    vrt->path, (uintptr_t)vbe_proto_ident);
 	AN(be->tcp_pool);
 
 	vbp = vrt->probe;
diff --git a/bin/varnishd/cache/cache_tcp_pool.c b/bin/varnishd/cache/cache_tcp_pool.c
index 63691b91b..49a2836c8 100644
--- a/bin/varnishd/cache/cache_tcp_pool.c
+++ b/bin/varnishd/cache/cache_tcp_pool.c
@@ -85,7 +85,7 @@ struct conn_pool {
 
 	const struct cp_methods			*methods;
 
-	const void				*id;
+	uintmax_t				id;
 	void					*priv;
 
 	VTAILQ_ENTRY(conn_pool)			list;
@@ -201,7 +201,7 @@ vcp_handle(struct waited *w, enum wait_event ev, vtim_real now)
  */
 
 static struct conn_pool *
-VCP_Ref(const void *id, const void *priv)
+VCP_Ref(uintmax_t id, const void *priv)
 {
 	struct conn_pool *cp;
 
@@ -224,7 +224,7 @@ VCP_Ref(const void *id, const void *priv)
  */
 
 static void *
-VCP_New(struct conn_pool *cp, const void *id, void *priv,
+VCP_New(struct conn_pool *cp, uintmax_t id, void *priv,
     const struct cp_methods *cm)
 {
 
@@ -728,7 +728,7 @@ static const struct cp_methods vus_methods = {
 
 struct tcp_pool *
 VTP_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6, const char *uds,
-	const void *id)
+	uintmax_t id)
 {
 	struct tcp_pool *tp;
 	struct conn_pool *cp;
diff --git a/bin/varnishd/cache/cache_tcp_pool.h b/bin/varnishd/cache/cache_tcp_pool.h
index 3c872336f..d7608da85 100644
--- a/bin/varnishd/cache/cache_tcp_pool.h
+++ b/bin/varnishd/cache/cache_tcp_pool.h
@@ -53,7 +53,7 @@ void PFD_RemoteName(const struct pfd *, char *, unsigned, char *, unsigned);
 struct VSC_vbe;
 
 struct tcp_pool *VTP_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6,
-    const char *uds, const void *id);
+    const char *uds, uintmax_t id);
 	/*
 	 * Get a reference to a TCP pool. Either one or both of ip4 or
 	 * ip6 arg must be non-NULL, or uds must be non-NULL. If recycling


More information about the varnish-commit mailing list