Commit 8418b610 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Make sure error works in vcl_fetch

error was unimplemented in vcl_fetch.  Implement it and add a test
case.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3263 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ea2bfcce
......@@ -426,6 +426,14 @@ cnt_fetch(struct sess *sp)
break;
case VCL_RET_DELIVER:
break;
case VCL_RET_ERROR:
sp->step = STP_ERROR;
sp->obj->ttl = 0;
sp->obj->cacheable = 0;
HSH_Unbusy(sp);
HSH_Deref(sp->obj);
sp->obj = NULL;
return (0);
default:
WRONG("Illegal action in vcl_fetch{}");
}
......
# $Id$
test "Check that error in vcl_fetch works"
server s1 {
rxreq
txresp -body "012345\n"
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set obj.http.Foo = "bar";
error 523 "not ok";
}
} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 523
} -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