]> err.no Git - varnish/commitdiff
Assert that the lengths of the storage for the object add up.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 28 Jun 2006 16:57:50 +0000 (16:57 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 28 Jun 2006 16:57:50 +0000 (16:57 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@255 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor.c

index d1cac276cf0112d386ca01188a9d3b0e1b6847ed..281d56c14592d461577ab0156a45bd5d894002df 100644 (file)
@@ -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);
 }