From: phk Date: Tue, 1 Aug 2006 16:26:10 +0000 (+0000) Subject: more miniobj checks X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfaded157b5bb17d3abb7cf3f03453167783397e;p=varnish more miniobj checks git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@590 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_response.c b/varnish-cache/bin/varnishd/cache_response.c index 2aab60fe..9361f257 100644 --- a/varnish-cache/bin/varnishd/cache_response.c +++ b/varnish-cache/bin/varnishd/cache_response.c @@ -131,6 +131,7 @@ RES_WriteObj(struct sess *sp) double dt; struct timespec t_resp; + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); clock_gettime(CLOCK_REALTIME, &t_resp); dt = (t_resp.tv_sec - sp->t_req.tv_sec); dt += (t_resp.tv_nsec - sp->t_req.tv_nsec) * 1e-9; @@ -158,10 +159,13 @@ RES_WriteObj(struct sess *sp) http_SetHeader(sp->fd, sp->http, "Connection: close"); WRK_Reset(sp->wrk, &sp->fd); sp->wrk->acct.hdrbytes += http_Write(sp->wrk, sp->http, 1); + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); /* XXX: conditional request handling */ if (sp->wantbody) { TAILQ_FOREACH(st, &sp->obj->store, list) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC); assert(st->stevedore != NULL); u += st->len; sp->wrk->acct.bodybytes += st->len; @@ -169,6 +173,8 @@ RES_WriteObj(struct sess *sp) WRK_Write(sp->wrk, st->ptr, st->len); } else { st->stevedore->send(st, sp); + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC); sp->wrk->niov = 0; sp->wrk->liov = 0; }