From 567f0cbd6cf516b75bb51f38a31cb3d31cf7f408 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 24 Mar 2008 08:45:54 +0000 Subject: [PATCH] If the backend does not transmit a respose string, use the default string for the status code as found in RFC2616. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2609 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_http.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index e817c322..d8d09fa3 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -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); } -- 2.39.5