]> err.no Git - varnish/commitdiff
If the backend does not transmit a respose string, use the default
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 24 Mar 2008 08:45:54 +0000 (08:45 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 24 Mar 2008 08:45:54 +0000 (08:45 +0000)
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

index e817c3226fa12bdfe5a48b120f9aa7e8194f2c16..d8d09fa3f80d5224f3d64bd2ace60f5e06fbdca3 100644 (file)
@@ -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);
 }