[3.0] 12f835b Format %D as microseconds in integer value

Martin Blix Grydeland martin at varnish-software.com
Fri May 16 14:24:27 CEST 2014

commit 12f835be3772b1598b7e15b6c799f2cd13d784d3
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri May 16 14:19:47 2014 +0200

    Format %D as microseconds in integer value
    Do as we have documented we do (and Apache does), printing the %D as
    request time in microseconds, truncated to an integer value.

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 9bd2423..d941aae 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -665,7 +665,7 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
 		case 'D':
 			/* %D */
-			VSB_printf(os, "%f", lp->df_D);
+			VSB_printf(os, "%d", (int)(lp->df_D * 1e6));
 		case 'H':

More information about the varnish-commit mailing list