[master] 9aa7fae23 Busyobj->do_pass was surplus to requirements, ->uncacheable is plenty.

Poul-Henning Kamp phk at FreeBSD.org
Mon May 17 11:31:05 UTC 2021


commit 9aa7fae23f6f2eeb1831be2383d8eb688d892f28
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 17 11:29:06 2021 +0000

    Busyobj->do_pass was surplus to requirements, ->uncacheable is plenty.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 4bb321b78..273eeb16b 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -259,9 +259,9 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
 
 	HTTP_Setup(bo->bereq0, bo->ws, bo->vsl, SLT_BereqMethod);
 	http_FilterReq(bo->bereq0, bo->req->http,
-	    bo->do_pass ? HTTPH_R_PASS : HTTPH_R_FETCH);
+	    bo->uncacheable ? HTTPH_R_PASS : HTTPH_R_FETCH);
 
-	if (bo->do_pass)
+	if (bo->uncacheable)
 		AZ(bo->stale_oc);
 	else {
 		http_ForceField(bo->bereq0, HTTP_HDR_METHOD, "GET");
@@ -366,7 +366,7 @@ vbf_304_logic(struct busyobj *bo)
 		HTTP_Merge(bo->wrk, bo->stale_oc, bo->beresp);
 		assert(http_IsStatus(bo->beresp, 200));
 		bo->was_304 = 1;
-	} else if (!bo->do_pass) {
+	} else if (!bo->uncacheable) {
 		/*
 		 * Backend sent unallowed 304
 		 */
@@ -397,7 +397,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 	CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
 
 	AZ(bo->storage);
-	bo->storage = bo->do_pass ? stv_transient : STV_next();
+	bo->storage = bo->uncacheable ? stv_transient : STV_next();
 
 	if (bo->retries > 0)
 		http_Unset(bo->bereq, "\012X-Varnish:");
@@ -406,7 +406,6 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 
 	VCL_backend_fetch_method(bo->vcl, wrk, NULL, bo, NULL);
 
-	bo->uncacheable = bo->do_pass;
 	if (wrk->handling == VCL_RET_ABANDON || wrk->handling == VCL_RET_FAIL)
 		return (F_STP_FAIL);
 
@@ -538,7 +537,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 		bo->uncacheable = 1;
 		wrk->handling = VCL_RET_DELIVER;
 	}
-	if (bo->do_pass || bo->uncacheable)
+	if (bo->uncacheable)
 		oc->flags |= OC_F_HFM;
 
 	assert(wrk->handling == VCL_RET_DELIVER);
@@ -1114,7 +1113,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
 	switch (mode) {
 	case VBF_PASS:
 		how = "pass";
-		bo->do_pass = 1;
+		bo->uncacheable = 1;
 		break;
 	case VBF_NORMAL:
 		how = "fetch";
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 34fde97a1..b39fa6fe5 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -201,6 +201,8 @@ Resp_Setup_Synth(struct req *req)
 		http_SetHeader(h, "Connection: close");
 }
 
+#include <stdio.h>
+
 static enum req_fsm_nxt v_matchproto_(req_state_f)
 cnt_deliver(struct worker *wrk, struct req *req)
 {
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index 4a1e50860..186de5092 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -262,7 +262,7 @@ VRT_r_bereq_uncacheable(VRT_CTX)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
-	return (ctx->bo->do_pass);
+	return (ctx->bo->uncacheable);
 }
 
 VCL_VOID
diff --git a/include/tbl/bo_flags.h b/include/tbl/bo_flags.h
index ac0fdf241..4a4f1dd4b 100644
--- a/include/tbl/bo_flags.h
+++ b/include/tbl/bo_flags.h
@@ -39,7 +39,6 @@ BO_FLAG(do_esi,		0, 1, 1, 1, "")
 BO_FLAG(do_gzip,	0, 1, 1, 1, "")
 BO_FLAG(do_gunzip,	0, 1, 1, 1, "")
 BO_FLAG(do_stream,	0, 1, 1, 0, "")
-BO_FLAG(do_pass,	0, 0, 0, 0, "")
 BO_FLAG(uncacheable,	0, 0, 0, 0, "")
 BO_FLAG(was_304,	0, 1, 0, 0, "")
 BO_FLAG(is_bgfetch,	1, 0, 0, 0, "")


More information about the varnish-commit mailing list