[master] ba9a611 Collaps the backend TCP pools to only identify by {IPv4+IPv6}
Poul-Henning Kamp
phk at FreeBSD.org
Mon Mar 9 20:57:47 CET 2015
commit ba9a6117fe0a7ba2a0900b9466ad113500095a1b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Mar 9 19:57:16 2015 +0000
Collaps the backend TCP pools to only identify by {IPv4+IPv6}
diff --git a/bin/varnishd/cache/cache_backend.h b/bin/varnishd/cache/cache_backend.h
index 2fa7694..b2bf2ca 100644
--- a/bin/varnishd/cache/cache_backend.h
+++ b/bin/varnishd/cache/cache_backend.h
@@ -116,7 +116,7 @@ void VBP_Remove(struct backend *b, struct vrt_backend_probe const *p);
void VBP_Use(const struct backend *b, const struct vrt_backend_probe *p);
void VBP_Summary(struct cli *cli, const struct vbp_target *vt);
-struct tcp_pool *VBT_Ref(const char *name, const struct suckaddr *ip4,
+struct tcp_pool *VBT_Ref(const struct suckaddr *ip4,
const struct suckaddr *ip6);
void VBT_Rel(struct tcp_pool **tpp);
int VBT_Open(const struct tcp_pool *tp, double tmo, const struct suckaddr **sa);
diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index a9fdd12..fc619c0 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -103,8 +103,7 @@ VBE_AddBackend(const char *vcl, const struct vrt_backend *vb)
b->ipv6_addr = vb->ipv6_addr;
b->port = vb->port;
- b->tcp_pool = VBT_Ref(vb->vcl_name,
- vb->ipv4_suckaddr, vb->ipv6_suckaddr);
+ b->tcp_pool = VBT_Ref(vb->ipv4_suckaddr, vb->ipv6_suckaddr);
/*
* Copy over the sockaddrs
diff --git a/bin/varnishd/cache/cache_backend_tcp.c b/bin/varnishd/cache/cache_backend_tcp.c
index 424f276..5b73e57 100644
--- a/bin/varnishd/cache/cache_backend_tcp.c
+++ b/bin/varnishd/cache/cache_backend_tcp.c
@@ -131,21 +131,18 @@ tcp_handle(struct waited *w, enum wait_event ev, double now)
}
/*--------------------------------------------------------------------
- * Reference a TCP pool given by {name, ip4, ip6} triplet. Create if
- * it doesn't exist already.
+ * Reference a TCP pool given by {ip4, ip6} pair. Create if it
+ * doesn't exist already.
*/
struct tcp_pool *
-VBT_Ref(const char *name, const struct suckaddr *ip4,
- const struct suckaddr *ip6)
+VBT_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6)
{
struct tcp_pool *tp;
ASSERT_CLI();
VTAILQ_FOREACH(tp, &pools, list) {
assert(tp->refcnt > 0);
- if (strcmp(tp->name, name))
- continue;
if (ip4 == NULL) {
if (tp->ip4 != NULL)
continue;
@@ -170,7 +167,6 @@ VBT_Ref(const char *name, const struct suckaddr *ip4,
ALLOC_OBJ(tp, TCP_POOL_MAGIC);
AN(tp);
- REPLACE(tp->name, name);
if (ip4 != NULL)
tp->ip4 = VSA_Clone(ip4);
if (ip6 != NULL)
More information about the varnish-commit
mailing list