Commit 6cd23c2a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix HEAD requests with ESI processing: Only call vfp->end if we

called vfp->begin.

Fixes: #871, #870
parent c3c23079
......@@ -514,14 +514,17 @@ FetchBody(struct sess *sp)
cls = fetch_straight(sp, sp->wrk->htc,
sp->wrk->h_content_length);
mklen = 1;
XXXAZ(sp->wrk->vfp->end(sp));
break;
case BS_CHUNKED:
cls = fetch_chunked(sp, sp->wrk->htc);
mklen = 1;
XXXAZ(sp->wrk->vfp->end(sp));
break;
case BS_EOF:
cls = fetch_eof(sp, sp->wrk->htc);
mklen = 1;
XXXAZ(sp->wrk->vfp->end(sp));
break;
case BS_ERROR:
cls = 1;
......@@ -532,8 +535,8 @@ FetchBody(struct sess *sp)
mklen = 0;
INCOMPL();
}
XXXAZ(sp->wrk->vfp->end(sp));
AZ(sp->wrk->vgz_rx);
/*
* It is OK for ->end to just leave the last storage segment
* sitting on sp->wrk->storage, we will always call vfp_nop_end()
......
# $Id$
test "test HEAD against ESI processing"
server s1 {
rxreq
expect req.url == "/1"
txresp -bodylen 1
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.do_esi = true;
}
} -start
client c1 {
txreq -url "/1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
txreq -req "HEAD" -url "/1"
rxresp -no_obj
expect resp.status == 200
} -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