[master] 1e639d1 If we are not going to stream, wait for BOS_FINISH.

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 20 10:51:09 CEST 2014


commit 1e639d1c41b0be6af3007b3b832ba8829655b00e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 20 08:50:43 2014 +0000

    If we are not going to stream, wait for BOS_FINISH.

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 4649231..30507ff 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -138,8 +138,14 @@ cnt_deliver(struct worker *wrk, struct req *req)
 
 	/* Grab a ref to the bo if there is one, and hand it down */
 	bo = HSH_RefBusy(req->objcore);
-	if (bo != NULL && req->esi_level == 0 && bo->state == BOS_FINISHED)
-		VBO_DerefBusyObj(wrk, &bo);
+	if (bo != NULL) {
+		if (req->esi_level == 0 && bo->state == BOS_FINISHED) {
+			VBO_DerefBusyObj(wrk, &bo);
+		} else if (!bo->do_stream) {
+			VBO_waitstate(bo, BOS_FINISHED);
+			VBO_DerefBusyObj(wrk, &bo);
+		}
+	}
 	V1D_Deliver(req, bo);
 	if (bo != NULL)
 		VBO_DerefBusyObj(wrk, &bo);



More information about the varnish-commit mailing list