[master] d8094d2 Set streaming by default, to flush out problems. (We don't actually stream yet, we just pretend for some of the way)

Poul-Henning Kamp phk at varnish-cache.org
Thu May 3 11:34:31 CEST 2012


commit d8094d26a5d5d582f4f0aca8c28227040ebd39cb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu May 3 09:33:35 2012 +0000

    Set streaming by default, to flush out problems.  (We don't actually
    stream yet, we just pretend for some of the way)
    
    Fix a couple of tests to DTRT accordingly.

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 0489734..7fa0291 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -134,6 +134,8 @@ VBO_GetBusyObj(struct worker *wrk)
 
 	WS_Init(bo->ws, "bo", p, bo->end - p);
 
+	bo->do_stream = 1;
+
 	return (bo);
 }
 
diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index e343aa8..cce170c 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -212,23 +212,15 @@ cnt_prepresp(struct sess *sp, struct worker *wrk, struct req *req)
 	CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
 	CHECK_OBJ_NOTNULL(req->vcl, VCL_CONF_MAGIC);
 
-	if (bo != NULL) {
+	if (bo != NULL)
 		CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
-		AN(bo->do_stream);
-	}
 
 	req->res_mode = 0;
 
 	if (bo == NULL)
 		req->res_mode |= RES_LEN;
 
-	if (bo != NULL &&
-	    (bo->h_content_length != NULL ||
-	    !bo->do_stream) &&
-	    !bo->do_gzip && !bo->do_gunzip)
-		req->res_mode |= RES_LEN;
-
-	if (!req->disable_esi && req->obj->esidata != NULL) {
+	if (bo == NULL && !req->disable_esi && req->obj->esidata != NULL) {
 		/* In ESI mode, we don't know the aggregate length */
 		req->res_mode &= ~RES_LEN;
 		req->res_mode |= RES_ESI;
@@ -883,7 +875,8 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
 		HSH_Unbusy(&wrk->stats, req->obj->objcore);
 	}
 
-	if (Pool_Task(wrk->pool, &bo->fetch_task, POOL_NO_QUEUE))
+	if (!bo->do_stream ||
+	    Pool_Task(wrk->pool, &bo->fetch_task, POOL_NO_QUEUE))
 		FetchBody(wrk, bo);
 
 	while (bo->state < BOS_FAILED)



More information about the varnish-commit mailing list