#undef HTTPH
/* cache_pass.c */
-void PassSession(struct sess *sp);
+int PassSession(struct sess *sp);
void PassBody(struct sess *sp);
/* cache_pipe.c */
{
assert(sp->vbc == NULL);
- PassSession(sp);
- assert(sp->vbc != NULL);
- sp->step = STP_PASSBODY;
+ if (!PassSession(sp)) {
+ assert(sp->vbc != NULL);
+ sp->step = STP_PASSBODY;
+ } else
+ sp->step = STP_DONE;
return (0);
}
/*--------------------------------------------------------------------*/
-void
+int
PassSession(struct sess *sp)
{
int i;
w = sp->wrk;
vc = VBE_GetFd(sp->backend, sp->xid);
+ if (vc == NULL) {
+ RES_Error(sp, 503, "Backend did not respond.");
+ return (1);
+ }
assert(vc != NULL);
VSL(SLT_Backend, sp->fd, "%d %s", vc->fd, sp->backend->vcl_name);
assert(sp->vbc == NULL);
sp->vbc = vc;
+ return (0);
}