Intermediate relief to avoid panic in VDP_bytes()

Due to a relatively recent change in varnish-cache, VDP_Close() in the
parallel esi thread can race VDP_Deliver in the deliver thread,
resulting in a panic.

See #19 for details
parent 92ec4800
...@@ -83,12 +83,12 @@ client c1 { ...@@ -83,12 +83,12 @@ client c1 {
txreq -hdr "Host: foo" txreq -hdr "Host: foo"
rxresp rxresp
expect resp.status == 200 expect resp.status == 200
expect resp.bodylen == 73 expect resp.bodylen == 65
expect resp.body == { expect resp.body == {
<html> <html>
Before include Before include
ouch! ouch!
Included
After include After include
</html> </html>
} }
......
...@@ -1274,6 +1274,17 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1274,6 +1274,17 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
INIT_OBJ(ctx, VRT_CTX_MAGIC); INIT_OBJ(ctx, VRT_CTX_MAGIC);
VCL_Req2Ctx(ctx, req); VCL_Req2Ctx(ctx, req);
#ifndef ISSUE19_RELIEF
// #19 disable streaming for now
if (boc != NULL)
ObjWaitState(req->objcore, BOS_FINISHED);
if (req->objcore->flags & OC_F_FAILED) {
if (!pesi->pecx->incl_cont)
tree_latch_error(tree, -1);
return;
}
#endif
if (gz->is && obj_gzipped && !(req->res_mode & RES_ESI)) { if (gz->is && obj_gzipped && !(req->res_mode & RES_ESI)) {
/* OA_GZIPBITS are not valid until BOS_FINISHED */ /* OA_GZIPBITS are not valid until BOS_FINISHED */
if (boc != NULL) if (boc != NULL)
......
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