]> err.no Git - varnish/commitdiff
Cache the numeric status code.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 30 Sep 2007 20:08:26 +0000 (20:08 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 30 Sep 2007 20:08:26 +0000 (20:08 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2062 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_http.c

index fcaa870d7465b397b153d228e706c8828254227d..90f342f7a227b9502e706d2576ffef3eda932e69 100644 (file)
@@ -116,6 +116,7 @@ struct http {
 
        unsigned char           conds;          /* If-* headers present */
        enum httpwhence         logtag;
+       int                     status;
 
        txt                     hd[HTTP_HDR_MAX];
        unsigned char           hdf[HTTP_HDR_MAX];
index 4eb331d49c20310e45c8f5890913bddb6dd2868a..1b58ae9162fac598abdd4581e916aab79f5bc393 100644 (file)
@@ -327,8 +327,10 @@ http_GetStatus(const struct http *hp)
 {
 
        Tcheck(hp->hd[HTTP_HDR_STATUS]);
-       return (strtoul(hp->hd[HTTP_HDR_STATUS].b,
-           NULL /* XXX */, 10));
+       if (hp->status == 0)
+               hp->status = strtoul(hp->hd[HTTP_HDR_STATUS].b,
+                   NULL /* XXX */, 10));
+       return (hp->status);
 }
 
 const char *