]> err.no Git - varnish/commitdiff
Only attempt to decode status integer if we have a good separation.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 8 Oct 2007 11:28:39 +0000 (11:28 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 8 Oct 2007 11:28:39 +0000 (11:28 +0000)
Possibly ticket #164

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2089 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_http.c

index c7d60b1c421581bffb7f9f83e0b4f54529dd39f0..f79f2230ad231f5e94996b0b16d31f1f6d3423ae 100644 (file)
@@ -503,7 +503,12 @@ http_DissectResponse(struct worker *w, const struct http_conn *htc, struct http
 
        if (i != 0 || memcmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.", 7))
                WSLR(w, SLT_HttpGarbage, htc->fd, htc->rxbuf);
-       hp->status = strtoul(hp->hd[HTTP_HDR_STATUS].b, NULL /* XXX */, 10);
+       if (i != 0 && hp->status == 0) {
+               hp->status = i;
+       } else {
+               hp->status = 
+                   strtoul(hp->hd[HTTP_HDR_STATUS].b, NULL /* XXX */, 10);
+       }
        return (i);
 }