Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Don't consider pass an error when doing streaming fetch.
Browse files Browse the repository at this point in the history
Patch by: tnt
  • Loading branch information
mbgrydeland committed Jun 20, 2012
1 parent 82c4b09 commit 8c821b7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/varnishd/cache_center.c
Expand Up @@ -930,13 +930,13 @@ cnt_streambody(struct sess *sp)
AZ(sp->vbc);
AN(sp->director);

if (!i && sp->obj->objcore != NULL) {
if (i)
sp->doclose = "Stream error";
else if (sp->obj->objcore != NULL) {
EXP_Insert(sp->obj);
AN(sp->obj->objcore);
AN(sp->obj->objcore->ban);
HSH_Unbusy(sp);
} else {
sp->doclose = "Stream error";
}
sp->wrk->acct_tmp.fetch++;
sp->director = NULL;
Expand Down
26 changes: 26 additions & 0 deletions bin/varnishtest/tests/r01157.vtc
@@ -0,0 +1,26 @@
varnishtest "#1157 - Connection close on pass and do_stream"

server s1 {
rxreq
txresp
expect req.url == "/"

rxreq
txresp
expect req.url == "/"
} -start

varnish v1 -vcl+backend {
sub vcl_recv { return (pass); }
sub vcl_fetch { set beresp.do_stream = true; }
} -start

client c1 {
txreq -url /
rxresp
expect resp.status == 200

txreq -url /
rxresp
expect resp.status == 200
} -run

0 comments on commit 8c821b7

Please sign in to comment.