[master] f0397b830 Tighten an assert, and replicate it another place with similar constraints.

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 5 18:08:08 UTC 2018


commit f0397b8306389860cdf01d84e934577ad718524f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 5 18:07:06 2018 +0000

    Tighten an assert, and replicate it another place with similar
    constraints.
    
    Related to: #2763

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 57583239a..bedc6dae7 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -195,7 +195,7 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
 	if (bo->stale_oc != NULL &&
 	    ObjCheckFlag(bo->wrk, bo->stale_oc, OF_IMSCAND) &&
 	    (bo->stale_oc->boc != NULL || ObjGetLen(wrk, bo->stale_oc) != 0)) {
-		AZ(bo->stale_oc->flags & OC_F_PASS);
+		AZ(bo->stale_oc->flags & (OC_F_PASS|OC_F_PRIVATE));
 		q = HTTP_GetHdrPack(bo->wrk, bo->stale_oc, H_Last_Modified);
 		if (q != NULL)
 			http_PrintfHeader(bo->bereq0,
@@ -355,6 +355,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 	if (http_IsStatus(bo->beresp, 304)) {
 		if (bo->stale_oc != NULL &&
 		    ObjCheckFlag(bo->wrk, bo->stale_oc, OF_IMSCAND)) {
+			AZ(bo->stale_oc->flags & (OC_F_PASS|OC_F_PRIVATE));
 			if (ObjCheckFlag(bo->wrk, bo->stale_oc, OF_CHGGZIP)) {
 				/*
 				 * If we changed the gzip status of the object


More information about the varnish-commit mailing list