r590 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Aug 1 18:26:11 CEST 2006


Author: phk
Date: 2006-08-01 18:26:10 +0200 (Tue, 01 Aug 2006)
New Revision: 590

Modified:
   trunk/varnish-cache/bin/varnishd/cache_response.c
Log:
more miniobj checks


Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c	2006-08-01 15:09:20 UTC (rev 589)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c	2006-08-01 16:26:10 UTC (rev 590)
@@ -131,6 +131,7 @@
 	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 @@
 		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 @@
 				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;
 			}




More information about the varnish-commit mailing list