[master] 8435381 Don't emit Length records for piped requests

Tollef Fog Heen tfheen at varnish-cache.org
Mon May 30 13:34:30 CEST 2011


commit 84353810d7e8aff9de925066ce3392093001d0b9
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Mon May 30 13:28:16 2011 +0200

    Don't emit Length records for piped requests
    
    We don't have a file descriptor for piped requests, so just don't emit
    a Length record.
    
    Fixes: #923

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index 7f4eedc..7325f5a 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -323,7 +323,10 @@ cnt_done(struct sess *sp)
 		da = sp->t_end - sp->t_resp;
 		dh = sp->t_req - sp->t_open;
 		/* XXX: Add StatReq == StatSess */
-		WSP(sp, SLT_Length, "%ju", (uintmax_t)sp->acct_req.bodybytes);
+		/* XXX: Workaround for pipe */
+		if (sp->fd >= 0) {
+			WSP(sp, SLT_Length, "%ju", (uintmax_t)sp->acct_req.bodybytes);
+		}
 		WSL(sp->wrk, SLT_ReqEnd, sp->id, "%u %.9f %.9f %.9f %.9f %.9f",
 		    sp->xid, sp->t_req, sp->t_end, dh, dp, da);
 	}



More information about the varnish-commit mailing list