[master] 5713c11 Eliminate the only actual use of vbc->backend, in preparation for getting rid of it entirely.

Poul-Henning Kamp phk at FreeBSD.org
Wed Jun 24 22:45:12 CEST 2015


commit 5713c119032b1f948c076ee3d2602643b2e972a9
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jun 24 17:06:46 2015 +0000

    Eliminate the only actual use of vbc->backend, in preparation for getting
    rid of it entirely.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 8883de1..490c11b 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -723,7 +723,7 @@ vtr_deliver_f V1D_Deliver;
 
 /* cache_http1_pipe.c */
 void V1P_Init(void);
-void V1P_Process(struct req *req, struct busyobj *bo, int fd);
+void V1P_Process(struct req *, struct busyobj *, int fd, struct VSC_C_vbe *);
 
 /* cache_req_body.c */
 int VRB_Ignore(struct req *req);
diff --git a/bin/varnishd/http1/cache_http1_pipe.c b/bin/varnishd/http1/cache_http1_pipe.c
index aba7445..04ee8dd 100644
--- a/bin/varnishd/http1/cache_http1_pipe.c
+++ b/bin/varnishd/http1/cache_http1_pipe.c
@@ -76,6 +76,7 @@ static void
 pipecharge(struct req *req, const struct acct_pipe *a, struct VSC_C_vbe *b)
 {
 
+	AN(b);
 	VSLb(req->vsl, SLT_PipeAcct, "%ju %ju %ju %ju",
 	    (uintmax_t)a->req,
 	    (uintmax_t)a->bereq,
@@ -86,16 +87,14 @@ pipecharge(struct req *req, const struct acct_pipe *a, struct VSC_C_vbe *b)
 	VSC_C_main->s_pipe_hdrbytes += a->req;
 	VSC_C_main->s_pipe_in += a->in;
 	VSC_C_main->s_pipe_out += a->out;
-	if (b != NULL) {
-		b->pipe_hdrbytes += a->bereq;
-		b->pipe_out += a->in;
-		b->pipe_in += a->out;
-	}
+	b->pipe_hdrbytes += a->bereq;
+	b->pipe_out += a->in;
+	b->pipe_in += a->out;
 	Lck_Unlock(&pipestat_mtx);
 }
 
 void
-V1P_Process(struct req *req, struct busyobj *bo, int fd)
+V1P_Process(struct req *req, struct busyobj *bo, int fd, struct VSC_C_vbe *vsc)
 {
 	struct worker *wrk;
 	struct pollfd fds[2];
@@ -170,7 +169,7 @@ V1P_Process(struct req *req, struct busyobj *bo, int fd)
 		}
 	}
 	VSLb_ts_req(req, "PipeSess", W_TIM_real(wrk));
-	pipecharge(req, &acct_pipe, bo->htc->vbc->backend->vsc);
+	pipecharge(req, &acct_pipe, vsc);
 	SES_Close(req->sp, SC_TX_PIPE);
 	bo->htc->doclose = SC_TX_PIPE;
 }



More information about the varnish-commit mailing list