[master] 555735f Even harder asserts for kristians test

Poul-Henning Kamp phk at varnish-cache.org
Wed Aug 24 13:24:00 CEST 2011


commit 555735f004468b9f7606382a8be31e95685f89c0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Aug 24 11:23:48 2011 +0000

    Even harder asserts for kristians test

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index 775fdcd..c1d3651 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -164,6 +164,9 @@ cnt_prepresp(struct sess *sp)
 	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
 
+	if (sp->wrk->do_stream)
+		AssertObjCorePassOrBusy(sp->obj->objcore);
+
 	sp->wrk->res_mode = 0;
 
 	if ((sp->wrk->h_content_length != NULL || !sp->wrk->do_stream) &&
@@ -242,10 +245,12 @@ cnt_prepresp(struct sess *sp)
 	default:
 		WRONG("Illegal action in vcl_deliver{}");
 	}
-	if (sp->wrk->do_stream)
+	if (sp->wrk->do_stream) {
+		AssertObjCorePassOrBusy(sp->obj->objcore);
 		sp->step = STP_STREAMBODY;
-	else
+	} else {
 		sp->step = STP_DELIVER;
+	}
 	return (0);
 }
 
@@ -817,8 +822,9 @@ cnt_fetchbody(struct sess *sp)
 	    RFC2616_Do_Cond(sp))
 		sp->wrk->do_stream = 0;
 
+	AssertObjCorePassOrBusy(sp->obj->objcore);
+
 	if (sp->wrk->do_stream) {
-		AssertObjCorePassOrBusy(sp->obj->objcore);
 		sp->step = STP_PREPRESP;
 		return (0);
 	}
@@ -886,6 +892,8 @@ cnt_streambody(struct sess *sp)
 
 	RES_StreamStart(sp);
 
+	AssertObjCorePassOrBusy(sp->obj->objcore);
+
 	i = FetchBody(sp);
 
 	sp->wrk->h_content_length = NULL;



More information about the varnish-commit mailing list