Commit be036844 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

More asserts


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@528 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ea6181e0
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment