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

Poul-Henning Kamp phk at phk.freebsd.dk
Sat Jan 26 09:13:37 UTC 2019


--------
In message <20190125123407.86CC092EA8 at lists.varnish-cache.org>, Nils Goroll writes:

>    Take two: When writing binary logs, always include Begin/End/Link tags
>    
>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);

Doesn't this change the interpretation of user-provided arguments ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the varnish-commit mailing list