Commit 3122a82d authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r4232: Add a new SHMLOG tag FetchError and record why a backend fetch croaked.



git-svn-id: http://www.varnish-cache.org/svn/branches/2.0@4326 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent cde0f53c
......@@ -70,8 +70,11 @@ fetch_straight(struct sess *sp, struct http_conn *htc, const char *b)
while (cl > 0) {
i = HTC_Read(htc, p, cl);
if (i <= 0)
if (i <= 0) {
WSP(sp, SLT_FetchError,
"straight read_error: %d", errno);
return (-1);
}
p += i;
cl -= i;
}
......@@ -110,8 +113,11 @@ fetch_chunked(struct sess *sp, struct http_conn *htc)
/* If we didn't succeed, add to buffer, try again */
if (q == NULL || q == buf || *q != '\n') {
if (bp >= be)
if (bp >= be) {
WSP(sp, SLT_FetchError,
"chunked hex-line too long");
return (-1);
}
/*
* The semantics we need here is "read until you have
* received at least one character, but feel free to
......@@ -128,8 +134,11 @@ fetch_chunked(struct sess *sp, struct http_conn *htc)
* at a time.
*/
i = HTC_Read(htc, bp, 1);
if (i <= 0)
if (i <= 0) {
WSP(sp, SLT_FetchError,
"chunked read_error: %d", errno);
return (-1);
}
bp += i;
continue;
}
......@@ -241,8 +250,11 @@ fetch_eof(struct sess *sp, struct http_conn *htc)
AN(p);
AN(st);
i = HTC_Read(htc, p, v);
if (i < 0)
if (i < 0) {
WSP(sp, SLT_FetchError,
"eof read_error: %d", errno);
return (-1);
}
if (i == 0)
break;
p += i;
......
......@@ -56,8 +56,6 @@ SLTM(ClientAddr)
SLTM(Backend)
SLTM(Length)
SLTM(FetchError)
SLTM(RxRequest)
SLTM(RxResponse)
SLTM(RxStatus)
......@@ -103,3 +101,5 @@ SLTM(ESI_xmlerror)
SLTM(Hash)
SLTM(Backend_health)
SLTM(FetchError)
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