[master] 5b2888f Make vbf_fetch_body_helper() a proper step in the fsm.

Poul-Henning Kamp phk at FreeBSD.org
Fri Oct 21 09:07:04 CEST 2016


commit 5b2888f3556a0cffc7d89d5db99e97f467eb7a17
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Oct 18 20:09:25 2016 +0000

    Make vbf_fetch_body_helper() a proper step in the fsm.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 9051689..4c6fa7d 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -482,8 +482,8 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 /*--------------------------------------------------------------------
  */
 
-static void
-vbf_fetch_body_helper(struct busyobj *bo)
+static enum fetch_step
+vbf_stp_fetchbody(struct busyobj *bo)
 {
 	ssize_t l;
 	uint8_t *ptr;
@@ -542,6 +542,7 @@ vbf_fetch_body_helper(struct busyobj *bo)
 	}
 
 	ObjTrimStore(bo->wrk, vfc->oc);
+	return (F_STP_FETCHEND);
 }
 
 /*--------------------------------------------------------------------
@@ -695,8 +696,14 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 
 	if (bo->htc->body_status != BS_NONE) {
 		assert(bo->htc->body_status != BS_ERROR);
-		vbf_fetch_body_helper(bo);
+		return (F_STP_FETCHBODY);
 	}
+	return (F_STP_FETCHEND);
+}
+
+static enum fetch_step
+vbf_stp_fetchend(struct worker *wrk, struct busyobj *bo)
+{
 
 	VFP_Close(bo->vfc);
 
diff --git a/include/tbl/steps.h b/include/tbl/steps.h
index 2d2bf66..62bb7a3 100644
--- a/include/tbl/steps.h
+++ b/include/tbl/steps.h
@@ -50,6 +50,8 @@ FETCH_STEP(retry,	RETRY,		(wrk, bo))
 FETCH_STEP(startfetch,	STARTFETCH,	(wrk, bo))
 FETCH_STEP(condfetch,	CONDFETCH,	(wrk, bo))
 FETCH_STEP(fetch,	FETCH,		(wrk, bo))
+FETCH_STEP(fetchbody,	FETCHBODY,	(bo))
+FETCH_STEP(fetchend,	FETCHEND,	(wrk, bo))
 FETCH_STEP(error,	ERROR,		(wrk, bo))
 FETCH_STEP(fail,	FAIL,		(wrk, bo))
 FETCH_STEP(done,	DONE,		())



More information about the varnish-commit mailing list