From: phk Date: Thu, 20 Jul 2006 14:40:54 +0000 (+0000) Subject: More asserts X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=283212fffbe3067fe750f2a3cac7975e0964450d;p=varnish More asserts git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@528 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index a052a358..6cf3f04e 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -41,6 +41,7 @@ fetch_straight(const struct sess *sp, int fd, struct http *hp, char *b) cl = strtoumax(b, NULL, 0); st = stevedore->alloc(stevedore, cl); + assert(st->stevedore != NULL); TAILQ_INSERT_TAIL(&sp->obj->store, st, list); st->len = cl; sp->obj->len = cl; @@ -105,6 +106,7 @@ fetch_chunked(const struct sess *sp, int fd, struct http *hp) } else { st = stevedore->alloc(stevedore, stevedore->trim == NULL ? u : CHUNK_PREALLOC); + assert(st->stevedore != NULL); TAILQ_INSERT_TAIL(&sp->obj->store, st, list); p = st->ptr; } @@ -177,6 +179,7 @@ fetch_eof(const struct sess *sp, int fd, struct http *hp) while (1) { if (v == 0) { st = stevedore->alloc(stevedore, CHUNK_PREALLOC); + assert(st->stevedore != NULL); TAILQ_INSERT_TAIL(&sp->obj->store, st, list); p = st->ptr + st->len; v = st->space - st->len; diff --git a/varnish-cache/bin/varnishd/cache_response.c b/varnish-cache/bin/varnishd/cache_response.c index 4290007c..8596b62b 100644 --- a/varnish-cache/bin/varnishd/cache_response.c +++ b/varnish-cache/bin/varnishd/cache_response.c @@ -196,6 +196,7 @@ RES_WriteObj(struct sess *sp) /* XXX: conditional request handling */ if (!strcmp(sp->http->req, "GET")) { TAILQ_FOREACH(st, &sp->obj->store, list) { + assert(st->stevedore != NULL); u += st->len; if (st->stevedore->send == NULL) { RES_Write(sp, st->ptr, st->len);