Ensure that transports call VDP_Close()

parent 20aee1b7
......@@ -59,7 +59,15 @@ VDP_Panic(struct vsb *vsb, const struct vdp_ctx *vdc)
VSB_cat(vsb, "},\n");
}
/*
* Ensure that transports have called VDP_Close()
* to avoid leaks in VDPs
*/
void
VDP_Fini(struct vdp_ctx *vdc)
{
assert(VTAILQ_EMPTY(&vdc->vdp));
}
void
VDP_Init(struct vdp_ctx *vdc, struct worker *wrk, struct vsl_log *vsl,
......
......@@ -313,6 +313,8 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
wrk->stats->ws_client_overflow++;
wrk->seen_methods = 0;
VDP_Fini(req->vdc);
}
/*----------------------------------------------------------------------
......
......@@ -189,6 +189,7 @@ void VDI_Event(const struct director *d, enum vcl_event_e ev);
void VDI_Init(void);
/* cache_deliver_proc.c */
void VDP_Fini(struct vdp_ctx *vdc);
void VDP_Init(struct vdp_ctx *vdc, struct worker *wrk, struct vsl_log *vsl,
struct req *req);
uint64_t VDP_Close(struct vdp_ctx *, struct objcore *, struct boc *);
......
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