[master] 26776d12f Take two: When writing binary logs, always include Begin/End/Link tags

Nils Goroll nils.goroll at uplex.de
Fri Jan 25 12:34:07 UTC 2019


commit 26776d12ff3eafd233b832e2bf228d23bd44457d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Jan 25 13:16:58 2019 +0100

    Take two: When writing binary logs, always include Begin/End/Link tags
    
    Apologies for the bad version in 1f32c1597a0927e3cd0f728069613e3377572a83
    
    Closes #2852

diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index 09f8983d5..003528b46 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -142,10 +142,19 @@ main(int argc, char * const *argv)
 		VUT_Error(vut, 1, "Missing -w option");
 
 	/* Setup output */
-	if (LOG.A_opt || !LOG.w_arg)
+	if (LOG.A_opt || !LOG.w_arg) {
 		vut->dispatch_f = VSL_PrintTransactions;
-	else
+	} else {
 		vut->dispatch_f = VSL_WriteTransactions;
+		/*
+		 * inefficient but not crossing API layers
+		 * first x argument avoids initial suppression of all tags
+		 */
+		AN(VUT_Arg(vut, 'x', "Link"));
+		AN(VUT_Arg(vut, 'i', "Link"));
+		AN(VUT_Arg(vut, 'i', "Begin"));
+		AN(VUT_Arg(vut, 'i', "End"));
+	}
 	if (LOG.w_arg) {
 		openout(LOG.a_opt);
 		AN(LOG.fo);


More information about the varnish-commit mailing list