[6.0] 5882d268f Start registering VDPs

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Feb 6 10:11:09 UTC 2019


commit 5882d268fc481a7a697d6f219ce5feb299b25ab2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Oct 11 10:13:04 2018 +0000

    Start registering VDPs
    
    Conflicts:
            bin/varnishd/cache/cache_vcl.c
            bin/varnishd/cache/cache_vcl.h
            bin/varnishd/cache/cache_vrt_filter.c
    
    It was possible to back-port this change without bringing beresp.filters
    and changing the VRT interface. So we get the benefits of this change
    and more that will follow and leave the possibility to minor-bump VRT to
    back-port beresp.filters in the future if that doesn't break.
    
    This clearly breaks $ABI strict VMODs, but that's part of the deal.

diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index 2c31a3c7b..30af823e4 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -128,3 +128,5 @@ struct vdp_ctx {
 
 int VDP_bytes(struct req *, enum vdp_action act, const void *ptr, ssize_t len);
 int VDP_push(struct req *, const struct vdp *, void *priv, int bottom);
+void VRT_AddVDP(VRT_CTX, const struct vdp *);
+void VRT_RemoveVDP(VRT_CTX, const struct vdp *);
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index fd364dcc5..d7a891802 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -406,6 +406,8 @@ VCL_Close(struct vcl **vclp)
 	CHECK_OBJ_NOTNULL(*vclp, VCL_MAGIC);
 	vcl = *vclp;
 	*vclp = NULL;
+	assert(VTAILQ_EMPTY(&vcl->vfps));
+	assert(VTAILQ_EMPTY(&vcl->vdps));
 	AZ(dlclose(vcl->dlh));
 	AZ(errno=pthread_rwlock_destroy(&vcl->temp_rwl));
 	FREE_OBJ(vcl);
@@ -567,6 +569,8 @@ vcl_load(struct cli *cli, struct vrt_ctx *ctx,
 	XXXAN(vcl->loaded_name);
 	VTAILQ_INIT(&vcl->director_list);
 	VTAILQ_INIT(&vcl->ref_list);
+	VTAILQ_INIT(&vcl->vfps);
+	VTAILQ_INIT(&vcl->vdps);
 
 	vcl->temp = VCL_TEMP_INIT;
 
diff --git a/bin/varnishd/cache/cache_vcl.h b/bin/varnishd/cache/cache_vcl.h
index 87433afe3..c49f4817e 100644
--- a/bin/varnishd/cache/cache_vcl.h
+++ b/bin/varnishd/cache/cache_vcl.h
@@ -28,6 +28,11 @@
  *
  */
 
+struct vfilter;
+
+VTAILQ_HEAD(vfilter_head, vfilter);
+
+
 struct vcl {
 	unsigned		magic;
 #define VCL_MAGIC		0x214188f2
@@ -45,6 +50,8 @@ struct vcl {
 	int			nrefs;
 	struct vcl		*label;
 	int			nlabels;
+	struct vfilter_head	vfps;
+	struct vfilter_head	vdps;
 };
 
 struct vclref {


More information about the varnish-commit mailing list