[master] 755836a Warn on VSL record batches containing records with VXID missmatch

Martin Blix Grydeland martin at varnish-software.com
Thu Feb 27 10:24:49 CET 2014


commit 755836a1c58f5ab6c6b2f895a077af33c88e088a
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Thu Feb 27 10:17:54 2014 +0100

    Warn on VSL record batches containing records with VXID missmatch

diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 0aee758..709b9fe 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -847,6 +847,11 @@ vtx_scan(struct VSLQ *vslq, struct vtx *vtx)
 
 	while (vslc_vtx_next(&vtx->c.cursor) == 1) {
 		ptr = vtx->c.cursor.rec.ptr;
+		if (VSL_ID(ptr) != vtx->key.vxid) {
+			(void)vtx_diag_tag(vtx, ptr, "vxid missmatch");
+			continue;
+		}
+
 		tag = VSL_TAG(ptr);
 		assert(tag != SLT__Batch);
 
@@ -1026,7 +1031,7 @@ static int
 vtx_diag_tag(struct vtx *vtx, const uint32_t *ptr, const char *reason)
 {
 
-	vtx_synth_rec(vtx, SLT_VSL, "%s (%s: %.*s)", reason,
+	vtx_synth_rec(vtx, SLT_VSL, "%s (%u:%s \"%.*s\")", reason, VSL_ID(ptr),
 	    VSL_tags[VSL_TAG(ptr)], (int)VSL_LEN(ptr), VSL_CDATA(ptr));
 	return (-1);
 }



More information about the varnish-commit mailing list