]> err.no Git - varnish/commitdiff
Sanitycheck that the length of an object adds up, right when we
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 3 Aug 2006 19:20:02 +0000 (19:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 3 Aug 2006 19:20:02 +0000 (19:20 +0000)
fetch it.

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

varnish-cache/bin/varnishd/cache_fetch.c

index 9a7802519f9ca224e2275dfb055c2a4e06f6a3a0..339b1e90859524570086fa7d8ecd3b21499e2673 100644 (file)
@@ -242,6 +242,17 @@ FetchBody(struct sess *sp)
        } else
                cls = 0;
 
+       {
+       /* Sanity check fetch methods accounting */
+               struct storage *st;
+               unsigned uu;
+
+               uu = 0;
+               TAILQ_FOREACH(st, &sp->obj->store, list)
+                       uu += st->len;
+               assert(uu == sp->obj->len);
+       }
+
        http_CopyHttp(&sp->obj->http, hp);
 
        if (http_GetHdr(vc->http, H_Connection, &b) && !strcasecmp(b, "close"))