[4.1] c8db16f Ident and type are optional

Martin Blix Grydeland martin at varnish-software.com
Thu Jun 15 14:45:06 CEST 2017


commit c8db16f0b8db8306d96c76970e941756c80c38df
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Wed Oct 26 14:51:57 2016 +0100

    Ident and type are optional
    
    Update the code to accommodate this.  Originally reported by Reinis
    Rozitis (r at roze.lv) on varnish-misc.
    
    Fixes #2118.
    
    Backport to 4.1

diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index 6af266e..67da9d6 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -379,10 +379,13 @@ vsc_filter_pt_list(struct VSM_data *vd)
 		VTAILQ_FOREACH_SAFE(pt, &vsc->pt_list, list, pt2) {
 			CHECK_OBJ_NOTNULL(pt, VSC_PT_MAGIC);
 			VSB_clear(vsb);
-			VSB_printf(vsb, "%s.%s.%s",
-			    pt->point.section->type,
-			    pt->point.section->ident,
-			    pt->point.desc->name);
+			if (strcmp(pt->point.section->type, ""))
+				VSB_printf(vsb, "%s.",
+				    pt->point.section->type);
+			if (strcmp(pt->point.section->ident, ""))
+				VSB_printf(vsb, "%s.",
+				    pt->point.section->ident);
+			VSB_printf(vsb, "%s", pt->point.desc->name);
 			VSB_finish(vsb);
 			if (fnmatch(sf->pattern, VSB_data(vsb), 0))
 				continue;



More information about the varnish-commit mailing list