From eecd99aa92cfd4e45365ed6531333fbae457810b Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 3 Aug 2006 19:20:02 +0000 Subject: [PATCH] Sanitycheck that the length of an object adds up, right when we 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index 9a780251..339b1e90 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -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")) -- 2.39.5