error was unimplemented in vcl_fetch. Implement it and add a test
case.
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{}");
}
--- /dev/null
+# $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