[master] f3c3e0e Also flush stdout before waiting for more data

Martin Blix Grydeland martin at varnish-cache.org
Wed Oct 9 16:03:04 CEST 2013


commit f3c3e0ee4681f2480b638993780a14396dea5fcd
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Wed Oct 9 14:48:17 2013 +0200

    Also flush stdout before waiting for more data

diff --git a/lib/libvarnishtools/vut.c b/lib/libvarnishtools/vut.c
index 8061722..caf80e6 100644
--- a/lib/libvarnishtools/vut.c
+++ b/lib/libvarnishtools/vut.c
@@ -203,7 +203,8 @@ VUT_Setup(void)
 		if (VUT.fo == NULL)
 			VUT_Error(1, "Can't open output file (%s)",
 			    VSL_Error(VUT.vsl));
-	}
+	} else
+		VUT.fo = stdout;
 
 	/* Create query */
 	VUT.vslq = VSLQ_New(VUT.vsl, &c, VUT.g_arg, VUT.q_arg);
@@ -270,6 +271,7 @@ VUT_Main(VSLQ_dispatch_f *func, void *priv)
 			func = VSL_WriteTransactions;
 		else
 			func = VSL_PrintTransactions;
+		AN(VUT.fo);
 		priv = VUT.fo;
 	}
 
@@ -344,6 +346,8 @@ VUT_Main(VSLQ_dispatch_f *func, void *priv)
 
 	if (VUT.vslq != NULL)
 		VSLQ_Flush(VUT.vslq, func, priv);
+	if (VUT.fo)
+		fflush(VUT.fo);
 
 	return (i);
 }



More information about the varnish-commit mailing list