Commit 91046df1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

more miniobj checks


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@590 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 37b049eb
......@@ -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;
}
......
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