[master] dc6f44ce9 Finally, make VDP_Close() take vdp_ctx instead of req arg.
Poul-Henning Kamp
phk at FreeBSD.org
Mon Oct 26 20:07:10 UTC 2020
commit dc6f44ce9450cd184fd34144fd9d4f77a0599415
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Oct 26 20:05:50 2020 +0000
Finally, make VDP_Close() take vdp_ctx instead of req arg.
diff --git a/bin/varnishd/cache/cache_deliver_proc.c b/bin/varnishd/cache/cache_deliver_proc.c
index c1fe1ad9a..076532bcf 100644
--- a/bin/varnishd/cache/cache_deliver_proc.c
+++ b/bin/varnishd/cache/cache_deliver_proc.c
@@ -149,18 +149,16 @@ VDP_Push(struct vdp_ctx *vdc, struct ws *ws, const struct vdp *vdp, void *priv)
}
uint64_t
-VDP_Close(struct req *req)
+VDP_Close(struct vdp_ctx *vdc)
{
struct vdp_entry *vdpe;
- struct vdp_ctx *vdc;
uint64_t rv = 0;
- CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
- vdc = req->vdc;
+ CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
while (!VTAILQ_EMPTY(&vdc->vdp)) {
vdpe = VTAILQ_FIRST(&vdc->vdp);
rv = vdpe->bytes_in;
- VSLb(req->vsl, SLT_VdpAcct, "%s %ju %ju", vdpe->vdp->name,
+ VSLb(vdc->vsl, SLT_VdpAcct, "%s %ju %ju", vdpe->vdp->name,
(uintmax_t)vdpe->calls, (uintmax_t)rv);
if (vdc->retval >= 0)
AN(vdpe);
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index d7030cc35..6179b7bcc 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -880,5 +880,5 @@ ved_deliver(struct req *req, struct boc *boc, int wantbody)
if (i && req->doclose == SC_NULL)
req->doclose = SC_REM_CLOSE;
- req->acct.resp_bodybytes += VDP_Close(req);
+ req->acct.resp_bodybytes += VDP_Close(req->vdc);
}
diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index 60a2a53c1..e3b3cc613 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -155,7 +155,7 @@ extern const struct vdp VDP_range;
void VDP_Init(struct vdp_ctx *vdx, struct worker *wrk, struct vsl_log *vsl,
struct req *req);
-uint64_t VDP_Close(struct req *req);
+uint64_t VDP_Close(struct vdp_ctx *);
int VDP_DeliverObj(struct vdp_ctx *vdc, struct objcore *oc);
int VDP_bytes(struct vdp_ctx *, enum vdp_action act, const void *ptr, ssize_t len);
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index aad32808f..77ef66f3f 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -158,7 +158,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
AZ(req->wrk->v1l);
req->acct.resp_hdrbytes += hdrbytes;
- req->acct.resp_bodybytes += VDP_Close(req);
+ req->acct.resp_bodybytes += VDP_Close(req->vdc);
if (sc == SC_NULL && err && req->sp->fd >= 0)
sc = SC_REM_CLOSE;
diff --git a/bin/varnishd/http2/cache_http2_deliver.c b/bin/varnishd/http2/cache_http2_deliver.c
index 3e257f151..4ee707816 100644
--- a/bin/varnishd/http2/cache_http2_deliver.c
+++ b/bin/varnishd/http2/cache_http2_deliver.c
@@ -339,5 +339,5 @@ h2_deliver(struct req *req, struct boc *boc, int sendbody)
}
AZ(req->wrk->v1l);
- req->acct.resp_bodybytes += VDP_Close(req);
+ req->acct.resp_bodybytes += VDP_Close(req->vdc);
}
More information about the varnish-commit
mailing list