Mailing List Archive

[master] a48139143 filter: Mark VRT_{Add, Remove}V[DF]P() as deprecated
commit a48139143182e4b3d87d48c17bb544037ed2ebc2
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Thu Mar 17 15:25:33 2022 +0100

filter: Mark VRT_{Add,Remove}V[DF]P() as deprecated

diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index ceee01310..2b262d1eb 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -93,9 +93,8 @@ enum vfp_status VFP_Suck(struct vfp_ctx *, void *p, ssize_t *lp);
enum vfp_status VFP_Error(struct vfp_ctx *, const char *fmt, ...)
v_printflike_(2, 3);

-/* These two deprecated per 2021-12-01, add v_deprecated_ after next major */
-void VRT_AddVFP(VRT_CTX, const struct vfp *);
-void VRT_RemoveVFP(VRT_CTX, const struct vfp *);
+void v_deprecated_ VRT_AddVFP(VRT_CTX, const struct vfp *);
+void v_deprecated_ VRT_RemoveVFP(VRT_CTX, const struct vfp *);

/* Deliver processors ------------------------------------------------*/

@@ -152,9 +151,8 @@ struct vdp_ctx {

int VDP_bytes(struct vdp_ctx *, enum vdp_action act, const void *, ssize_t);

-/* These two deprecated per 2021-12-01, add v_deprecated_ after next major */
-void VRT_AddVDP(VRT_CTX, const struct vdp *);
-void VRT_RemoveVDP(VRT_CTX, const struct vdp *);
+void v_deprecated_ VRT_AddVDP(VRT_CTX, const struct vdp *);
+void v_deprecated_ VRT_RemoveVDP(VRT_CTX, const struct vdp *);

/* Registry functions -------------------------------------------------*/
const char *VRT_AddFilter(VRT_CTX, const struct vfp *, const struct vdp *);
diff --git a/include/vrt.h b/include/vrt.h
index 441095920..b149ad215 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -53,6 +53,11 @@
* Whenever something is deleted or changed in a way which is not
* binary/load-time compatible, increment MAJOR version
*
+ * NEXT (2022-09-15)
+ * VRT_AddVDP() deprecated
+ * VRT_AddVFP() deprecated
+ * VRT_RemoveVDP() deprecated
+ * VRT_RemoveVFP() deprecated
* 15.0 (2022-03-15)
* VRT_r_req_transport() added
* VRT_Assign_Backend() added
diff --git a/vmod/vmod_debug.c b/vmod/vmod_debug.c
index 654b4f433..d1149b09b 100644
--- a/vmod/vmod_debug.c
+++ b/vmod/vmod_debug.c
@@ -453,20 +453,17 @@ event_load(VRT_CTX, struct vmod_priv *priv)
priv->priv = priv_vcl;
priv->methods = priv_vcl_methods;

- VRT_AddVFP(ctx, &xyzzy_vfp_rot13);
- VRT_AddVDP(ctx, &xyzzy_vdp_rot13);
+ AZ(VRT_AddFilter(ctx, &xyzzy_vfp_rot13, &xyzzy_vdp_rot13));

// This should fail
AN(VRT_AddFilter(ctx, &xyzzy_vfp_rot13, &xyzzy_vdp_rot13));
// Reset the error, we know what we're doing.
*ctx->handling = 0;

- VRT_RemoveVFP(ctx, &xyzzy_vfp_rot13);
- VRT_RemoveVDP(ctx, &xyzzy_vdp_rot13);
-
+ VRT_RemoveFilter(ctx, &xyzzy_vfp_rot13, &xyzzy_vdp_rot13);
AZ(VRT_AddFilter(ctx, &xyzzy_vfp_rot13, &xyzzy_vdp_rot13));

- VRT_AddVDP(ctx, &xyzzy_vdp_pedantic);
+ VRT_AddFilter(ctx, NULL, &xyzzy_vdp_pedantic);
return (0);
}

@@ -629,7 +626,7 @@ event_discard(VRT_CTX, void *priv)
AZ(ctx->msg);

VRT_RemoveFilter(ctx, &xyzzy_vfp_rot13, &xyzzy_vdp_rot13);
- VRT_RemoveVDP(ctx, &xyzzy_vdp_pedantic);
+ VRT_RemoveFilter(ctx, NULL, &xyzzy_vdp_pedantic);

if (--loads)
return (0);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit