[master] 4ec6ef1 Don't stop reporting the VSL log just because the varnishd process is no longer around.

Poul-Henning Kamp phk at FreeBSD.org
Mon Nov 28 10:32:05 CET 2016


commit 4ec6ef1f613d7e6c45a0645153001d7f662672e0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Nov 28 09:31:21 2016 +0000

    Don't stop reporting the VSL log just because the varnishd process
    is no longer around.

diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index a3a9128..a0fdd47 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -233,37 +233,40 @@ varnishlog_thread(void *priv)
 
 		opt = VSL_COPT_TAIL;
 
-		i = VSL_Next(c);
+		while(1) {
+			i = VSL_Next(c);
+			if (i != 1)
+				break;
+
+			v->vsl_idle = 0;
+
+			tag = VSL_TAG(c->rec.ptr);
+			vxid = VSL_ID(c->rec.ptr);
+			if (tag != SLT_CLI)
+				v->vsl_idle = 0;
+			if (tag == SLT__Batch)
+				continue;
+			tagname = VSL_tags[tag];
+			len = VSL_LEN(c->rec.ptr);
+			type = VSL_CLIENT(c->rec.ptr) ?
+			    'c' : VSL_BACKEND(c->rec.ptr) ?
+			    'b' : '-';
+			data = VSL_CDATA(c->rec.ptr);
+			v->vsl_tag_count[tag]++;
+			vtc_log(v->vl, 4, "vsl| %10u %-15s %c %.*s",
+			    vxid, tagname, type, (int)len, data);
+		}
 		if (i == 0) {
 			v->vsl_idle++;
 			/* Nothing to do but wait */
 			VTIM_sleep(0.1);
-			continue;
 		} else if (i == -2) {
 			/* Abandoned - try reconnect */
 			VSL_DeleteCursor(c);
 			c = NULL;
 			VSM_Close(vsm);
-			continue;
-		} else if (i != 1)
+		} else 
 			break;
-
-		v->vsl_idle = 0;
-
-		tag = VSL_TAG(c->rec.ptr);
-		vxid = VSL_ID(c->rec.ptr);
-		if (tag != SLT_CLI)
-			v->vsl_idle = 0;
-		if (tag == SLT__Batch)
-			continue;
-		tagname = VSL_tags[tag];
-		len = VSL_LEN(c->rec.ptr);
-		type = VSL_CLIENT(c->rec.ptr) ? 'c' : VSL_BACKEND(c->rec.ptr) ?
-		    'b' : '-';
-		data = VSL_CDATA(c->rec.ptr);
-		v->vsl_tag_count[tag]++;
-		vtc_log(v->vl, 4, "vsl| %10u %-15s %c %.*s", vxid, tagname,
-		    type, (int)len, data);
 	}
 
 	v->vsl_idle = 100;



More information about the varnish-commit mailing list