Commit fce2ff23 authored by Pål Hermunn Johansen's avatar Pål Hermunn Johansen

Handle return(synth()) in vcl_pipe

Instead of panicking on a return(synth()) in vcl_pipe, we just proceed
to a normal synth.

Test by Dridi

Fixes #1890
parent 2d51524a
......@@ -569,6 +569,7 @@ static enum req_fsm_nxt
cnt_pipe(struct worker *wrk, struct req *req)
{
struct busyobj *bo;
enum req_fsm_nxt nxt;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
......@@ -588,15 +589,22 @@ cnt_pipe(struct worker *wrk, struct req *req)
VCL_pipe_method(req->vcl, wrk, req, bo, NULL);
if (wrk->handling == VCL_RET_SYNTH)
INCOMPL();
assert(wrk->handling == VCL_RET_PIPE);
SES_Close(req->sp, VDI_Http1Pipe(req, bo));
switch (wrk->handling) {
case VCL_RET_SYNTH:
req->req_step = R_STP_SYNTH;
nxt = REQ_FSM_MORE;
break;
case VCL_RET_PIPE:
SES_Close(req->sp, VDI_Http1Pipe(req, bo));
nxt = REQ_FSM_DONE;
break;
default:
WRONG("Illegal return from vcl_pipe{}");
}
http_Teardown(bo->bereq);
VBO_ReleaseBusyObj(wrk, &bo);
THR_SetBusyobj(NULL);
return (REQ_FSM_DONE);
return (nxt);
}
/*--------------------------------------------------------------------
......
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_pipe {
return (synth(401));
}
} -start
client c1 {
txreq -req PROPFIND
rxresp
expect resp.status == 401
} -run
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