Commit 90c15c4a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add SHMLOG records for more backend fetch failures



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4233 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent f73be4e2
......@@ -351,8 +351,10 @@ FetchHdr(struct sess *sp)
hp = sp->wrk->bereq;
VBE_GetFd(sp);
if (sp->vbe == NULL)
if (sp->vbe == NULL) {
WSP(sp, SLT_FetchError, "no backend connection");
return (__LINE__);
}
vc = sp->vbe;
/* Inherit the backend timeouts from the selected backend */
SES_InheritBackendTimeouts(sp);
......@@ -372,6 +374,7 @@ FetchHdr(struct sess *sp)
/* Deal with any message-body the request might have */
i = FetchReqBody(sp);
if (WRW_FlushRelease(w) || i > 0) {
WSP(sp, SLT_FetchError, "backend write error: %d", errno);
VBE_ClosedFd(sp);
/* XXX: other cleanup ? */
return (__LINE__);
......@@ -389,19 +392,21 @@ FetchHdr(struct sess *sp)
TCP_set_read_timeout(vc->fd, sp->first_byte_timeout);
do {
i = HTC_Rx(sp->wrk->htc);
if (i < 0) {
WSP(sp, SLT_FetchError,
"http read error: %d", errno);
VBE_ClosedFd(sp);
/* XXX: other cleanup ? */
return (__LINE__);
}
TCP_set_read_timeout(vc->fd, sp->between_bytes_timeout);
}
while (i == 0);
if (i < 0) {
VBE_ClosedFd(sp);
/* XXX: other cleanup ? */
return (__LINE__);
}
hp = sp->wrk->beresp;
if (http_DissectResponse(sp->wrk, sp->wrk->htc, hp)) {
WSP(sp, SLT_FetchError, "http format error");
VBE_ClosedFd(sp);
/* XXX: other cleanup ? */
return (__LINE__);
......@@ -552,5 +557,3 @@ Fetch_Init(void)
CLI_AddFuncs(DEBUG_CLI, debug_cmds);
}
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