[master] e51197f1d Output the name of duplicate filters

Nils Goroll nils.goroll at uplex.de
Mon Sep 19 13:44:05 UTC 2022


commit e51197f1df1b0c6bf4c4ab01bf647c75d94b08ab
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Sep 13 18:53:30 2022 +0200

    Output the name of duplicate filters
    
    The error message for duplicate filters did not mention the filter name
    and was thus not particularly helpful. It does now, for example:
    
            rot13: VFP already registered (per-vcl)

diff --git a/bin/varnishd/cache/cache_vrt_filter.c b/bin/varnishd/cache/cache_vrt_filter.c
index 1cfedc449..bf45372d1 100644
--- a/bin/varnishd/cache/cache_vrt_filter.c
+++ b/bin/varnishd/cache/cache_vrt_filter.c
@@ -103,7 +103,7 @@ vrt_addfilter(VRT_CTX, const struct vfp *vfp, const struct vdp *vdp)
 	err = is_dup_filter(hd, vfp, vdp, name);
 	if (err != NULL) {
 		if (ctx != NULL)
-			VRT_fail(ctx, "%s (global)", err);
+			VRT_fail(ctx, "%s: %s (global)", name, err);
 		return (err);
 	}
 	if (ctx != NULL) {
@@ -112,7 +112,7 @@ vrt_addfilter(VRT_CTX, const struct vfp *vfp, const struct vdp *vdp)
 		hd = &ctx->vcl->filters;
 		err = is_dup_filter(hd, vfp, vdp, name);
 		if (err != NULL) {
-			VRT_fail(ctx, "%s (per-vcl)", err);
+			VRT_fail(ctx, "%s: %s (per-vcl)", name, err);
 			return (err);
 		}
 	}


More information about the varnish-commit mailing list