switch (sp->handling) {
case VCL_RET_DELIVER:
break;
- default:
+ case VCL_RET_RESTART:
INCOMPL();
+ break;
+ default:
+ WRONG("Illegal action in vcl_deliver{}");
}
sp->director = NULL;
http_PutResponse(w, sp->fd, h,
http_StatusMessage(sp->err_code));
VCL_error_method(sp);
+ assert(sp->handling == VCL_RET_DELIVER);
sp->err_code = 0;
sp->err_reason = NULL;
sp->step = STP_DELIVER;
sp->bereq = NULL;
switch (sp->handling) {
- case VCL_RET_ERROR:
case VCL_RET_RESTART:
sp->obj->ttl = 0;
sp->obj->cacheable = 0;
HSH_Unbusy(sp);
HSH_Deref(sp->obj);
sp->obj = NULL;
- if (sp->handling == VCL_RET_ERROR)
- sp->step = STP_ERROR;
- else {
- sp->director = NULL;
- sp->restarts++;
- sp->step = STP_RECV;
- }
+ sp->director = NULL;
+ sp->restarts++;
+ sp->step = STP_RECV;
return (0);
case VCL_RET_PASS:
sp->obj->pass = 1;
case VCL_RET_DELIVER:
break;
default:
- INCOMPL();
+ WRONG("Illegal action in vcl_fetch{}");
}
sp->obj->cacheable = 1;
HSH_Deref(sp->obj);
sp->obj = NULL;
- if (sp->handling == VCL_RET_PASS) {
+ switch(sp->handling) {
+ case VCL_RET_PASS:
sp->step = STP_PASS;
return (0);
- }
-
- if (sp->handling == VCL_RET_ERROR) {
+ case VCL_RET_ERROR:
sp->step = STP_ERROR;
return (0);
+ case VCL_RET_RESTART:
+ INCOMPL();
+ return (0);
+ default:
+ WRONG("Illegal action in vcl_hit{}");
+ return (0);
}
-
- INCOMPL();
}
sp->hashptr = (void*)p;
VCL_hash_method(sp);
- /* XXX check error */
+ assert(sp->handling == VCL_RET_HASH);
}
o = HSH_Lookup(sp);
VBE_SelectBackend(sp);
http_FilterHeader(sp, HTTPH_R_FETCH);
VCL_miss_method(sp);
- if (sp->handling == VCL_RET_ERROR) {
+ switch(sp->handling) {
+ case VCL_RET_ERROR:
sp->obj->cacheable = 0;
HSH_Unbusy(sp);
HSH_Deref(sp->obj);
sp->bereq = NULL;
sp->step = STP_ERROR;
return (0);
- }
- if (sp->handling == VCL_RET_PASS) {
+ case VCL_RET_PASS:
sp->obj->cacheable = 0;
HSH_Unbusy(sp);
HSH_Deref(sp->obj);
VBE_free_bereq(sp->bereq);
sp->bereq = NULL;
return (0);
- }
- if (sp->handling == VCL_RET_FETCH) {
+ case VCL_RET_FETCH:
sp->step = STP_FETCH;
return (0);
+ case VCL_RET_RESTART:
+ INCOMPL();
+ return (0);
+ default:
+ WRONG("Illegal action in vcl_miss{}");
+ return (0);
}
- INCOMPL();
}
sp->step = STP_ERROR;
return (0);
}
+ assert(sp->handling == VCL_RET_PASS);
sp->wrk->acct.pass++;
HSH_Prealloc(sp);
sp->obj = sp->wrk->nobj;
if (sp->handling == VCL_RET_ERROR)
INCOMPL();
+ assert(sp->handling == VCL_RET_PIPE);
PipeSession(sp);
sp->step = STP_DONE;