[experimental-ims] e749a3e Make the VSL skeptical of zero-filled VSM.

Geoff Simmons geoff at varnish-cache.org
Mon Jan 9 21:51:59 CET 2012


commit e749a3ee4960ad05c3fc70901a472f2e75379b92
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 20 11:58:37 2011 +0000

    Make the VSL skeptical of zero-filled VSM.

diff --git a/include/vsl.h b/include/vsl.h
index 288c5c7..45406c0 100644
--- a/include/vsl.h
+++ b/include/vsl.h
@@ -66,6 +66,7 @@
  * on this file to extract the table rather than handcode it
  */
 enum VSL_tag_e {
+	SLT_Bogus = 0,
 #define SLTM(foo)	SLT_##foo,
 #include "vsl_tags.h"
 #undef SLTM
diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index 6791888..848fe65 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -173,6 +173,11 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
 	for (w = 0; w < TIMEOUT_USEC;) {
 		t = *vsl->log_ptr;
 
+		if (t == 0) {
+			/* Zero-initialized VSL */
+			VRMB();
+			continue;
+		}
 		if (t == VSL_WRAPMARKER) {
 			/* Wrap around not possible at front */
 			assert(vsl->log_ptr != vsl->log_start + 1);



More information about the varnish-commit mailing list