Commit 0f30a816 authored by Nils Goroll's avatar Nils Goroll

remove gotos

parent b3eac3f0
......@@ -2611,13 +2611,17 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
CHECK_OBJ_NOTNULL(parent, NODE_MAGIC);
assert(parent->type == T_NEXUS);
if (wantbody == 0)
goto close; // XXX
if (wantbody == 0) {
VDP_close(req);
return;
}
VSLdbgv(req, "vped_deliver: ObjGetLen=%lu",
ObjGetLen(req->wrk, req->objcore));
if (boc == NULL && ObjGetLen(req->wrk, req->objcore) == 0)
goto close; // XXX
if (boc == NULL && ObjGetLen(req->wrk, req->objcore) == 0) {
VDP_close(req);
return;
}
is_esi = ObjHasAttr(req->wrk, req->objcore, OA_ESIDATA);
is_final = (req->objcore->flags & OC_F_FINAL) != 0;
......@@ -2633,11 +2637,14 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
if (req->objcore->flags & OC_F_FAILED) {
/* No way of signalling errors in the middle of
the ESI body. Omit this ESI fragment. */
goto close; // XXX
VDP_close(req);
return;
}
}
if (is_final && !is_esi && !use_thread_blocking) {
VSLdbg(req, "vped_deliver: T_NEXUS buffering no ESI");
VDP_Push(req, &VDP_pesi_buf, pesi);
AN(parent);
XXXAZ(push_vdps(req, &parent->nexus.gzip));
......@@ -2648,7 +2655,8 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
/* pesi_buf does not pesi_destroy() on fini */
req->transport_priv = NULL;
pesi_destroy(&pesi);
goto noesi; // XXX
vped_close_vdp(req, 0, &VDP_pesi_buf);
return;
}
else if (is_final && !is_esi) {
VSLdbg(req, "vped_deliver: T_FINAL");
......@@ -2726,27 +2734,18 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
VSLdbg(req, "vped_deliver: ESI");
VDP_Push(req, &VDP_pesi_buf, pesi);
XXXAZ(push_vdps(req, &parent->nexus.gzip));
AZ(push_vdps(req, &parent->nexus.gzip));
AN(parent);
AZ(VDP_Push(req, &vped_to_parent, parent->req));
(void)VDP_DeliverObj(req);
/*
* was: VDP_close(req);
*
* only close the pesi VDPs, the others are to run from topreq delivery
*
* XXX cleanup
*/
vped_close_vdp(req, 0, &VDP_pesi);
noesi:
vped_close_vdp(req, 0, &VDP_pesi_buf);
out:
return;
close:
VDP_close(req);
goto out;
}
static const struct transport VPED_transport = {
......
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