[6.0] f4059aa68 Prefix VSM lines which add segments with a '+'
Martin Blix Grydeland
martin at varnish-software.com
Fri Oct 18 13:23:05 UTC 2019
commit f4059aa68a0df829d24e383b7408ddff5ca49434
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Jul 31 19:55:42 2019 +0000
Prefix VSM lines which add segments with a '+'
diff --git a/bin/varnishd/common/common_vsmw.c b/bin/varnishd/common/common_vsmw.c
index 339394b58..a71d3e307 100644
--- a/bin/varnishd/common/common_vsmw.c
+++ b/bin/varnishd/common/common_vsmw.c
@@ -132,7 +132,7 @@ vsmw_fmt_index(const struct vsmw *vsmw, const struct vsmwseg *seg)
CHECK_OBJ_NOTNULL(vsmw, VSMW_MAGIC);
CHECK_OBJ_NOTNULL(seg, VSMWSEG_MAGIC);
- VSB_printf(vsmw->vsb, "%s %zu %zu %s %s\n",
+ VSB_printf(vsmw->vsb, "+ %s %zu %zu %s %s\n",
seg->cluster->fn,
seg->off,
seg->len,
diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c
index 17699fc9f..1e200e75f 100644
--- a/lib/libvarnishapi/vsm.c
+++ b/lib/libvarnishapi/vsm.c
@@ -459,7 +459,7 @@ vsm_vlu_plus(struct vsm *vd, struct vsm_set *vs, const char *line)
int ac;
struct vsm_seg *vg2;
- av = VAV_Parse(line, &ac, 0);
+ av = VAV_Parse(line + 1, &ac, 0);
if (av[0] != NULL || ac < 4 || ac > 6) {
(void)(vsm_diag(vd,
@@ -508,14 +508,19 @@ vsm_vlu_func(void *priv, const char *line)
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
AN(line);
- if (line[0] == '#') {
+ switch (line[0]) {
+ case '#':
i = vsm_vlu_hash(vd, vs, line);
VTAILQ_FOREACH(vs->vg, &vs->segs, list)
vs->vg->flags &= ~VSM_FLAG_MARKSCAN;
if (!(vs->retval & VSM_MGT_RESTARTED))
vs->vg = VTAILQ_FIRST(&vs->segs);
- } else {
+ break;
+ case '+':
i = vsm_vlu_plus(vd, vs, line);
+ break;
+ default:
+ break;
}
return (i);
}
More information about the varnish-commit
mailing list