Commit 7459111a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

More backend error conditions changed from assert to 503


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1080 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8361777c
......@@ -550,6 +550,7 @@ cnt_miss(struct sess *sp)
HSH_Deref(sp->obj);
sp->obj = NULL;
sp->step = STP_DONE;
RES_Error(sp, 503, NULL);
return (0);
}
sp->step = STP_FETCH;
......
......@@ -322,16 +322,23 @@ FetchHeaders(struct sess *sp)
WRK_Reset(w, &vc->fd);
http_Write(w, vc->http, 0);
i = WRK_Flush(w);
xxxassert(i == 0);
if (WRK_Flush(w)) {
/* XXX: cleanup */
return (1);
}
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
i = http_RecvHead(vc->http, vc->fd);
xxxassert(i == 0);
xxxassert(http_DissectResponse(sp->wrk, vc->http, vc->fd) == 0);
if (http_RecvHead(vc->http, vc->fd)) {
/* XXX: cleanup */
return (1);
}
if (http_DissectResponse(sp->wrk, vc->http, vc->fd)) {
/* XXX: cleanup */
return (1);
}
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
......
......@@ -421,6 +421,10 @@ http_DissectResponse(struct worker *w, struct http *hp, int fd)
for (p = hp->s ; isspace(*p); p++)
continue;
if (memcmp(p, "HTTP/1.", 7)) {
WSLR(w, SLT_HttpGarbage, fd, hp->s, hp->v);
return (400);
}
/* First, protocol */
hp->hd[HTTP_HDR_PROTO].b = p;
while (!isspace(*p))
......
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