Commit 01b69b52 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

If the backend does not transmit a respose string, use the default

string for the status code as found in RFC2616.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2609 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent da147bca
......@@ -451,6 +451,9 @@ http_splitline(struct worker *w, int fd, struct http *hp, const struct http_conn
if (vctyp(*p, C_CTL))
return (400);
hp->hd[h3].e = p;
} else {
hp->hd[h3].b = p;
hp->hd[h3].e = p;
}
/* Skip CRLF */
......@@ -520,6 +523,13 @@ http_DissectResponse(struct worker *w, const struct http_conn *htc, struct http
hp->status =
strtoul(hp->hd[HTTP_HDR_STATUS].b, NULL /* XXX */, 10);
}
if (!Tlen(hp->hd[HTTP_HDR_RESPONSE])) {
/* Backend didn't send a response string, use the standard */
hp->hd[HTTP_HDR_RESPONSE].b =
TRUST_ME(http_StatusMessage(hp->status));
hp->hd[HTTP_HDR_RESPONSE].e =
strchr(hp->hd[HTTP_HDR_RESPONSE].b, '\0');
}
return (i);
}
......
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