[master] 95dd968 Don't assert on multiple End records seen in a record set.

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


commit 95dd9683ab3d4c4bb7423c7701721493bd00ea48
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Thu Feb 27 10:18:55 2014 +0100

    Don't assert on multiple End records seen in a record set.
    
    Spotted by: Dag

diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 709b9fe..3acdbd2 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -842,10 +842,8 @@ vtx_scan(struct VSLQ *vslq, struct vtx *vtx)
 	const uint32_t *ptr;
 	enum VSL_tag_e tag;
 
-	if (vtx->flags & VTX_F_END)
-		return;
-
-	while (vslc_vtx_next(&vtx->c.cursor) == 1) {
+	while (!(vtx->flags & VTX_F_COMPLETE) &&
+	    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");
@@ -867,12 +865,14 @@ vtx_scan(struct VSLQ *vslq, struct vtx *vtx)
 
 		case SLT_End:
 			vtx->flags |= VTX_F_END;
-			vtx_mark_complete(vslq, vtx);
 			break;
 		default:
 			break;
 		}
 	}
+
+	if (vtx->flags & VTX_F_END && !(vtx->flags & VTX_F_COMPLETE))
+		vtx_mark_complete(vslq, vtx);
 }
 
 /* Force a vtx into complete status by synthing the necessary outstanding



More information about the varnish-commit mailing list