[master] 90862a7 Add a BOS_PREP_STREAM state to notify stevedores before streaming starts.

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 24 20:04:04 CET 2016


commit 90862a70077fc25463e776d72325baab15675709
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 24 15:31:25 2016 +0000

    Add a BOS_PREP_STREAM state to notify stevedores before streaming
    starts.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index cbeccbf..08eaa2d 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -365,6 +365,7 @@ struct storeobj {
 enum boc_state_e {
 	BOS_INVALID = 0,	/* don't touch (yet) */
 	BOS_REQ_DONE,		/* beresp.* can be examined */
+	BOS_PREP_STREAM,	/* Prepare for streaming */
 	BOS_STREAM,		/* beresp.* can be examined */
 	BOS_FINISHED,		/* object is complete */
 	BOS_FAILED,		/* something went wrong */
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index aa3676b..609e6c2 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -672,6 +672,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	assert(bo->fetch_objcore->boc->state == BOS_REQ_DONE);
 
 	if (bo->do_stream) {
+		ObjSetState(wrk, bo->fetch_objcore, BOS_PREP_STREAM);
 		HSH_Unbusy(wrk, bo->fetch_objcore);
 		ObjSetState(wrk, bo->fetch_objcore, BOS_STREAM);
 	}
@@ -762,6 +763,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
 	AZ(ObjCopyAttr(bo->wrk, bo->fetch_objcore, bo->stale_oc, OA_GZIPBITS));
 
 	if (bo->do_stream) {
+		ObjSetState(wrk, bo->fetch_objcore, BOS_PREP_STREAM);
 		HSH_Unbusy(wrk, bo->fetch_objcore);
 		ObjSetState(wrk, bo->fetch_objcore, BOS_STREAM);
 	}
diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c
index 0248ee7..1bae372 100644
--- a/bin/varnishd/cache/cache_obj.c
+++ b/bin/varnishd/cache/cache_obj.c
@@ -54,7 +54,7 @@
  * 2	  ObjSetU32()
  * 2	  ObjSetU64()
  *
- * 2->3	ObjStable()	Will no longer be modified
+ * 2->3	ObjStable()	Will no longer be modified (clean up boc)
  *
  * 23	ObjHasAttr()
  * 23	ObjGetAttr()



More information about the varnish-commit mailing list