From: phk Date: Wed, 28 Jun 2006 16:57:50 +0000 (+0000) Subject: Assert that the lengths of the storage for the object add up. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58b4ab58831c95428dc18ee1d19cbfb88d6a504a;p=varnish Assert that the lengths of the storage for the object add up. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@255 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index d1cac276..281d56c1 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -88,14 +88,17 @@ void vca_write_obj(struct sess *sp, struct sbuf *hdr) { struct storage *st; + unsigned u = 0; vca_write(sp, sbuf_data(hdr), sbuf_len(hdr)); TAILQ_FOREACH(st, &sp->obj->store, list) { + u += st->len; if (st->stevedore->send != NULL) st->stevedore->send(st, sp); else vca_write(sp, st->ptr, st->len); } + assert(u == sp->obj->len); vca_flush(sp); }