r4980 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Tue Jun 22 09:15:18 CEST 2010


Author: phk
Date: 2010-06-22 09:15:16 +0200 (Tue, 22 Jun 2010)
New Revision: 4980

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_response.c
Log:
Emit Length for client side right before ReqEnd, to summarize ESI
transactions correctly.

Only Emmit Length and ReqEnd if we have an XID.

Fixes: #709
Fixes: #720



Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2010-06-21 15:33:56 UTC (rev 4979)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2010-06-22 07:15:16 UTC (rev 4980)
@@ -245,12 +245,14 @@
 	if (sp->xid == 0) {
 		sp->t_req = sp->t_end;
 		sp->t_resp = sp->t_end;
+	} else {
+		dp = sp->t_resp - sp->t_req;
+		da = sp->t_end - sp->t_resp;
+		dh = sp->t_req - sp->t_open;
+		WSP(sp, SLT_Length, "%u", 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);
 	}
-	dp = sp->t_resp - sp->t_req;
-	da = sp->t_end - sp->t_resp;
-	dh = sp->t_req - sp->t_open;
-	WSL(sp->wrk, SLT_ReqEnd, sp->id, "%u %.9f %.9f %.9f %.9f %.9f",
-	    sp->xid, sp->t_req, sp->t_end, dh, dp, da);
 
 	sp->xid = 0;
 	sp->t_open = sp->t_end;

Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c	2010-06-21 15:33:56 UTC (rev 4979)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c	2010-06-22 07:15:16 UTC (rev 4980)
@@ -49,8 +49,6 @@
 	char lm[64];
 	char *p;
 
-	WSP(sp, SLT_Length, "%u", 0);
-
 	http_ClrHeader(sp->wrk->resp);
 	sp->wrk->resp->logtag = HTTP_Tx;
 	http_SetResp(sp->wrk->resp, "HTTP/1.1", "304", "Not Modified");
@@ -202,8 +200,6 @@
 	if (sp->obj->response == 200 && sp->http->conds && res_do_conds(sp))
 		return;
 
-	WSP(sp, SLT_Length, "%u", sp->obj->len);
-
 	http_ClrHeader(sp->wrk->resp);
 	sp->wrk->resp->logtag = HTTP_Tx;
 	http_CopyResp(sp->wrk->resp, sp->obj->http);




More information about the varnish-commit mailing list