Commit 9d32fa37 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Replace VDP->fini()'s req arg with vdp_ctx.

parent faa60dc5
......@@ -160,7 +160,7 @@ VDP_Close(struct req *req)
if (vdpe != NULL) {
CHECK_OBJ(vdpe, VDP_ENTRY_MAGIC);
if (vdpe->vdp->fini != NULL)
AZ(vdpe->vdp->fini(req, &vdpe->priv));
AZ(vdpe->vdp->fini(vdc, &vdpe->priv));
AZ(vdpe->priv);
VTAILQ_REMOVE(&vdc->vdp, vdpe, list);
}
......
......@@ -286,11 +286,11 @@ ved_vdp_esi_init(struct req *req, void **priv)
}
static int v_matchproto_(vdp_fini_f)
ved_vdp_esi_fini(struct req *req, void **priv)
ved_vdp_esi_fini(struct vdp_ctx *vdc, void **priv)
{
struct ecx *ecx;
(void)req;
(void)vdc;
AN(priv);
CAST_OBJ_NOTNULL(ecx, *priv, ECX_MAGIC);
FREE_OBJ(ecx);
......@@ -500,9 +500,9 @@ ved_bytes(struct ecx *ecx, enum vdp_action act,
*/
static int v_matchproto_(vdp_fini_f)
ved_pretend_gzip_fini(struct req *req, void **priv)
ved_pretend_gzip_fini(struct vdp_ctx *vdc, void **priv)
{
(void)req;
(void)vdc;
*priv = NULL;
return (0);
}
......@@ -755,13 +755,13 @@ ved_gzgz_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
}
static int v_matchproto_(vdp_fini_f)
ved_gzgz_fini(struct req *req, void **priv)
ved_gzgz_fini(struct vdp_ctx *vdc, void **priv)
{
uint32_t icrc;
uint32_t ilen;
struct ved_foo *foo;
(void)req;
(void)vdc;
CAST_OBJ_NOTNULL(foo, *priv, VED_FOO_MAGIC);
*priv = NULL;
......@@ -793,9 +793,9 @@ static const struct vdp ved_gzgz = {
*/
static int v_matchproto_(vdp_fini_f)
ved_vdp_fini(struct req *req, void **priv)
ved_vdp_fini(struct vdp_ctx *vdc, void **priv)
{
(void)req;
(void)vdc;
*priv = NULL;
return (0);
}
......
......@@ -112,7 +112,7 @@ typedef int vdp_init_f(struct req *, void **priv);
struct vdp_ctx;
typedef int vdp_fini_f(struct req *, void **priv);
typedef int vdp_fini_f(struct vdp_ctx *, void **priv);
typedef int vdp_bytes_f(struct vdp_ctx *, enum vdp_action, void **priv,
const void *ptr, ssize_t len);
......
......@@ -341,11 +341,11 @@ vdp_gunzip_init(struct req *req, void **priv)
}
static int v_matchproto_(vdp_fini_f)
vdp_gunzip_fini(struct req *req, void **priv)
vdp_gunzip_fini(struct vdp_ctx *vdc, void **priv)
{
struct vgz *vg;
(void)req;
(void)vdc;
CAST_OBJ_NOTNULL(vg, *priv, VGZ_MAGIC);
AN(vg->m_buf);
(void)VGZ_Destroy(&vg);
......
......@@ -48,14 +48,15 @@ struct vrg_priv {
};
static int v_matchproto_(vdp_fini_f)
vrg_range_fini(struct req *req, void **priv)
vrg_range_fini(struct vdp_ctx *vdc, void **priv)
{
struct vrg_priv *vrg_priv;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vdc->req, REQ_MAGIC);
CAST_OBJ_NOTNULL(vrg_priv, *priv, VRG_PRIV_MAGIC);
if (vrg_priv->range_off < vrg_priv->range_high)
Req_Fail(req, SC_RANGE_SHORT);
Req_Fail(vdc->req, SC_RANGE_SHORT);
*priv = NULL; /* struct on ws, no need to free */
return (0);
}
......
......@@ -83,18 +83,19 @@ h2_init(struct req *req, void **priv)
}
static int v_matchproto_(vdp_fini_f)
h2_fini(struct req *req, void **priv)
h2_fini(struct vdp_ctx *vdc, void **priv)
{
struct h2_req *r2;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vdc->wrk, WORKER_MAGIC);
TAKE_OBJ_NOTNULL(r2, priv, H2_REQ_MAGIC);
if (r2->error)
return (0);
H2_Send_Get(req->wrk, r2->h2sess, r2);
H2_Send(req->wrk, r2, H2_F_DATA, H2FF_DATA_END_STREAM, 0, "", NULL);
H2_Send_Get(vdc->wrk, r2->h2sess, r2);
H2_Send(vdc->wrk, r2, H2_F_DATA, H2FF_DATA_END_STREAM, 0, "", NULL);
H2_Send_Rel(r2->h2sess, r2);
return (0);
}
......
......@@ -150,9 +150,9 @@ xyzzy_rot13_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
}
static int v_matchproto_(vdp_fini_f)
xyzzy_rot13_fini(struct req *req, void **priv)
xyzzy_rot13_fini(struct vdp_ctx *vdc, void **priv)
{
(void)req;
(void)vdc;
AN(priv);
free(*priv);
*priv = NULL;
......@@ -187,9 +187,9 @@ xyzzy_pedantic_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
}
static int v_matchproto_(vdp_fini_f)
xyzzy_pedantic_fini(struct req *req, void **priv)
xyzzy_pedantic_fini(struct vdp_ctx *vdc, void **priv)
{
(void) req;
(void) vdc;
assert (*priv == end_marker);
*priv = NULL;
return (0);
......
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