[master] 4e701d6 Add a VRT_CTX arg to vdir_new(), we will need it
Poul-Henning Kamp
phk at FreeBSD.org
Mon Apr 23 22:06:23 UTC 2018
commit 4e701d691e1b33922c9ce2cfb56bb2ff019746a6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Apr 23 21:27:57 2018 +0000
Add a VRT_CTX arg to vdir_new(), we will need it
diff --git a/lib/libvmod_directors/fall_back.c b/lib/libvmod_directors/fall_back.c
index 202431e..8ae3ddc 100644
--- a/lib/libvmod_directors/fall_back.c
+++ b/lib/libvmod_directors/fall_back.c
@@ -98,7 +98,7 @@ vmod_fallback__init(VRT_CTX,
ALLOC_OBJ(fb, VMOD_DIRECTORS_FALLBACK_MAGIC);
AN(fb);
*fbp = fb;
- vdir_new(&fb->vd, "fallback", vcl_name, vmod_fallback_healthy,
+ vdir_new(ctx, &fb->vd, "fallback", vcl_name, vmod_fallback_healthy,
vmod_fallback_resolve, fb);
fb->st = sticky;
}
diff --git a/lib/libvmod_directors/hash.c b/lib/libvmod_directors/hash.c
index 80a792e..a053081 100644
--- a/lib/libvmod_directors/hash.c
+++ b/lib/libvmod_directors/hash.c
@@ -59,7 +59,7 @@ vmod_hash__init(VRT_CTX, struct vmod_directors_hash **rrp,
ALLOC_OBJ(rr, VMOD_DIRECTORS_HASH_MAGIC);
AN(rr);
*rrp = rr;
- vdir_new(&rr->vd, "hash", vcl_name, NULL, NULL, rr);
+ vdir_new(ctx, &rr->vd, "hash", vcl_name, NULL, NULL, rr);
}
VCL_VOID v_matchproto_()
diff --git a/lib/libvmod_directors/random.c b/lib/libvmod_directors/random.c
index 91fb3ce..4ce6328 100644
--- a/lib/libvmod_directors/random.c
+++ b/lib/libvmod_directors/random.c
@@ -86,7 +86,7 @@ vmod_random__init(VRT_CTX, struct vmod_directors_random **rrp,
ALLOC_OBJ(rr, VMOD_DIRECTORS_RANDOM_MAGIC);
AN(rr);
*rrp = rr;
- vdir_new(&rr->vd, "random", vcl_name, vmod_random_healthy,
+ vdir_new(ctx, &rr->vd, "random", vcl_name, vmod_random_healthy,
vmod_random_resolve, rr);
}
diff --git a/lib/libvmod_directors/round_robin.c b/lib/libvmod_directors/round_robin.c
index 3c896cb..7e888f3 100644
--- a/lib/libvmod_directors/round_robin.c
+++ b/lib/libvmod_directors/round_robin.c
@@ -95,7 +95,7 @@ vmod_round_robin__init(VRT_CTX,
ALLOC_OBJ(rr, VMOD_DIRECTORS_ROUND_ROBIN_MAGIC);
AN(rr);
*rrp = rr;
- vdir_new(&rr->vd, "round-robin", vcl_name, vmod_rr_healthy,
+ vdir_new(ctx, &rr->vd, "round-robin", vcl_name, vmod_rr_healthy,
vmod_rr_resolve, rr);
}
diff --git a/lib/libvmod_directors/vdir.c b/lib/libvmod_directors/vdir.c
index 6a06412..95cc9df 100644
--- a/lib/libvmod_directors/vdir.c
+++ b/lib/libvmod_directors/vdir.c
@@ -50,11 +50,12 @@ vdir_expand(struct vdir *vd, unsigned n)
}
void
-vdir_new(struct vdir **vdp, const char *name, const char *vcl_name,
+vdir_new(VRT_CTX, struct vdir **vdp, const char *name, const char *vcl_name,
vdi_healthy_f *healthy, vdi_resolve_f *resolve, void *priv)
{
struct vdir *vd;
+ AN(ctx);
AN(name);
AN(vcl_name);
AN(vdp);
diff --git a/lib/libvmod_directors/vdir.h b/lib/libvmod_directors/vdir.h
index c4862e5..afdc421 100644
--- a/lib/libvmod_directors/vdir.h
+++ b/lib/libvmod_directors/vdir.h
@@ -41,7 +41,8 @@ struct vdir {
struct vbitmap *vbm;
};
-void vdir_new(struct vdir **vdp, const char *name, const char *vcl_name,
+void vdir_new(VRT_CTX, struct vdir **vdp, const char *name,
+ const char *vcl_name,
vdi_healthy_f *healthy, vdi_resolve_f *resolve, void *priv);
void vdir_delete(struct vdir **vdp);
void vdir_rdlock(struct vdir *vd);
More information about the varnish-commit
mailing list