[master] 74292b35f http1_deliver polish: save read/write once local variable

Nils Goroll nils.goroll at uplex.de
Mon Nov 25 17:30:04 UTC 2024


commit 74292b35f31bb3bf8636d2378304ef8611a28d38
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Nov 25 18:04:22 2024 +0100

    http1_deliver polish: save read/write once local variable

diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 9015f3cc0..edb32573e 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -74,7 +74,7 @@ V1D_Deliver(struct req *req, int sendbody)
 	struct vrt_ctx ctx[1];
 	int err = 0, chunked = 0;
 	stream_close_t sc;
-	uint64_t hdrbytes, bytes;
+	uint64_t bytes;
 	struct v1l *v1l;
 
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
@@ -136,7 +136,7 @@ V1D_Deliver(struct req *req, int sendbody)
 		return (VTR_D_DONE);
 	}
 
-	hdrbytes = HTTP1_Write(v1l, req->resp, HTTP1_Resp);
+	req->acct.resp_hdrbytes += HTTP1_Write(v1l, req->resp, HTTP1_Resp);
 
 	if (sendbody) {
 		if (DO_DEBUG(DBG_FLUSH_HEAD))
@@ -150,7 +150,6 @@ V1D_Deliver(struct req *req, int sendbody)
 
 	sc = V1L_Close(&v1l, &bytes);
 
-	req->acct.resp_hdrbytes += hdrbytes;
 	req->acct.resp_bodybytes += VDP_Close(req->vdc, req->objcore, req->boc);
 
 	if (sc == SC_NULL && err && req->sp->fd >= 0)


More information about the varnish-commit mailing list