r606 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Aug 2 19:27:33 CEST 2006


Author: phk
Date: 2006-08-02 19:27:33 +0200 (Wed, 02 Aug 2006)
New Revision: 606

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
More asserts, sp->vbc this time.


Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2006-08-02 15:55:06 UTC (rev 605)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2006-08-02 17:27:33 UTC (rev 606)
@@ -84,6 +84,7 @@
 {
 
 	assert(sp->obj == NULL);
+	assert(sp->vbc == NULL);
 	if (sp->fd >= 0 && sp->doclose != NULL)
 		vca_close_session(sp, sp->doclose);
 	VCL_Rel(sp->vcl);
@@ -163,6 +164,7 @@
 cnt_fetch(struct sess *sp)
 {
 
+	assert(sp->vbc != NULL);
 	RFC2616_cache_policy(sp, sp->vbc->http);
 
 	VCL_fetch_method(sp);
@@ -188,7 +190,9 @@
 	}
 	if (sp->handling == VCL_RET_INSERT) {
 		sp->obj->cacheable = 1;
+		assert(sp->vbc != NULL);
 		FetchBody(sp);
+		assert(sp->vbc == NULL);
 		HSH_Ref(sp->obj); /* get another, STP_DELIVER will deref */
 		HSH_Unbusy(sp->obj);
 		sp->wrk->acct.fetch++;
@@ -400,8 +404,10 @@
 	if (sp->handling == VCL_RET_LOOKUP)
 		INCOMPL();
 	if (sp->handling == VCL_RET_FETCH) {
+		assert(sp->vbc == NULL);
 		FetchHeaders(sp);
 		sp->step = STP_FETCH;
+		assert(sp->vbc != NULL);
 		return (0);
 	}
 	INCOMPL();
@@ -426,7 +432,9 @@
 cnt_pass(struct sess *sp)
 {
 
+	assert(sp->vbc == NULL);
 	PassSession(sp);
+	assert(sp->vbc != NULL);
 	sp->step = STP_PASSBODY;
 	return (0);
 }
@@ -451,7 +459,9 @@
 {
 
 	sp->wrk->acct.pass++;
+	assert(sp->vbc != NULL);
 	PassBody(sp);
+	assert(sp->vbc == NULL);
 	sp->step = STP_DONE;
 	return (0);
 }
@@ -518,6 +528,7 @@
 	sp->vcl = VCL_Get();
 
 	assert(sp->obj == NULL);
+	assert(sp->vbc == NULL);
 
 	sp->wrk->acct.req++;
 	done = http_DissectRequest(sp->http, sp->fd);




More information about the varnish-commit mailing list