Commit faa60dc5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make arguments to VDP_DeliverObj() explicit

parent dfe6df9a
...@@ -184,20 +184,23 @@ vdp_objiterator(void *priv, unsigned flush, const void *ptr, ssize_t len) ...@@ -184,20 +184,23 @@ vdp_objiterator(void *priv, unsigned flush, const void *ptr, ssize_t len)
} }
int int VDP_DeliverObj(struct vdp_ctx *vdc, struct objcore *oc, struct worker *wrk,
VDP_DeliverObj(struct req *req) struct vsl_log *vsl, struct req *req)
{ {
int r, final; int r, final;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
req->vdc->req = req; CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
req->vdc->vsl = req->vsl; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
req->vdc->wrk = req->wrk; AN(vsl);
final = req->objcore->flags & (OC_F_PRIVATE | OC_F_HFM | OC_F_HFP) CHECK_OBJ_ORNULL(req, REQ_MAGIC);
? 1 : 0; vdc->vsl = vsl;
r = ObjIterate(req->wrk, req->objcore, req->vdc, vdp_objiterator, final); vdc->wrk = wrk;
vdc->req = req;
final = oc->flags & (OC_F_PRIVATE | OC_F_HFM | OC_F_HFP) ? 1 : 0;
r = ObjIterate(wrk, oc, vdc, vdp_objiterator, final);
if (r == 0) if (r == 0)
r = VDP_bytes(req->vdc, VDP_END, NULL, 0); r = VDP_bytes(vdc, VDP_END, NULL, 0);
if (r < 0) if (r < 0)
return (r); return (r);
return (0); return (0);
......
...@@ -865,7 +865,8 @@ ved_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -865,7 +865,8 @@ ved_deliver(struct req *req, struct boc *boc, int wantbody)
} }
if (i == 0) { if (i == 0) {
i = VDP_DeliverObj(req); i = VDP_DeliverObj(
req->vdc, req->objcore, req->wrk, req->vsl, req);
} else { } else {
VSLb(req->vsl, SLT_Error, "Failure to push ESI processors"); VSLb(req->vsl, SLT_Error, "Failure to push ESI processors");
req->doclose = SC_OVERLOAD; req->doclose = SC_OVERLOAD;
......
...@@ -148,6 +148,14 @@ struct vdp_ctx { ...@@ -148,6 +148,14 @@ struct vdp_ctx {
struct req *req; struct req *req;
}; };
extern const struct vdp VDP_gunzip;
extern const struct vdp VDP_esi;
extern const struct vdp VDP_range;
uint64_t VDP_Close(struct req *req);
int VDP_DeliverObj(struct vdp_ctx *vdc, struct objcore *oc, struct worker *wrk,
struct vsl_log *vsl, struct req *req);
void VDP_Init(struct vdp_ctx *vdx); void VDP_Init(struct vdp_ctx *vdx);
int VDP_bytes(struct vdp_ctx *, enum vdp_action act, const void *ptr, ssize_t len); int VDP_bytes(struct vdp_ctx *, enum vdp_action act, const void *ptr, ssize_t len);
int VDP_Push(struct req *, const struct vdp *, void *priv); int VDP_Push(struct req *, const struct vdp *, void *priv);
......
...@@ -233,14 +233,6 @@ void CLI_Init(void); ...@@ -233,14 +233,6 @@ void CLI_Init(void);
void CLI_Run(void); void CLI_Run(void);
void CLI_AddFuncs(struct cli_proto *p); void CLI_AddFuncs(struct cli_proto *p);
/* cache_deliver_proc.c */
uint64_t VDP_Close(struct req *req);
int VDP_DeliverObj(struct req *req);
extern const struct vdp VDP_gunzip;
extern const struct vdp VDP_esi;
extern const struct vdp VDP_range;
/* cache_expire.c */ /* cache_expire.c */
void EXP_Init(void); void EXP_Init(void);
void EXP_Shutdown(void); void EXP_Shutdown(void);
......
...@@ -149,7 +149,8 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody) ...@@ -149,7 +149,8 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
(void)V1L_Flush(req->wrk); (void)V1L_Flush(req->wrk);
if (chunked) if (chunked)
V1L_Chunked(req->wrk); V1L_Chunked(req->wrk);
err = VDP_DeliverObj(req); err = VDP_DeliverObj(
req->vdc, req->objcore, req->wrk, req->vsl, req);
if (!err && chunked) if (!err && chunked)
V1L_EndChunk(req->wrk); V1L_EndChunk(req->wrk);
} }
......
...@@ -332,7 +332,8 @@ h2_deliver(struct req *req, struct boc *boc, int sendbody) ...@@ -332,7 +332,8 @@ h2_deliver(struct req *req, struct boc *boc, int sendbody)
/* XXX someone into H2 please add appropriate error handling */ /* XXX someone into H2 please add appropriate error handling */
if (sendbody) { if (sendbody) {
if (!VDP_Push(req, &h2_vdp, NULL)) if (!VDP_Push(req, &h2_vdp, NULL))
(void)VDP_DeliverObj(req); (void)VDP_DeliverObj(
req->vdc, req->objcore, req->wrk, req->vsl, req);
} }
AZ(req->wrk->v1l); AZ(req->wrk->v1l);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment