Move sending VDP_END to vdp_zipflow_put

parent 326a225c
......@@ -395,10 +395,8 @@ static int
vdp_zipflow_put(void *priv, void const *ptr, size_t len)
{
if (ptr == NULL || len == 0)
return (0);
return (VDP_bytes(priv, VDP_FLUSH, ptr, (ssize_t)len));
return (VDP_bytes(priv, ptr == NULL ? VDP_END : VDP_FLUSH,
ptr, (ssize_t)len));
}
static void
......@@ -486,13 +484,14 @@ vdp_zipflow_bytes(struct vdp_ctx *vdc, enum vdp_action act, void **priv,
struct zipflow_top *zft;
int r;
(void)vdc;
AN(priv);
CAST_OBJ_NOTNULL(zfr, *priv, ZIPFLOW_REQUEST_MAGIC);
zft = zfr->top;
CHECK_OBJ_NOTNULL(zft, ZIPFLOW_TOP_MAGIC);
if (zfr->bundle == 0) {
(void) zip_close(zft->zip);
return (1);
return (0);
}
assert(len >= 0);
r = zip_data(zft->zip, ptr, (size_t)len, act == VDP_END ? 1 : 0);
......@@ -509,5 +508,5 @@ vdp_zipflow_bytes(struct vdp_ctx *vdc, enum vdp_action act, void **priv,
if (r)
VSLb(vdc->vsl, SLT_Error, "zip_close returned %d", r);
memset(zfr, 0, sizeof *zfr);
return (VDP_bytes(vdc, VDP_END, NULL, (size_t)0));
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