[6.0] 57941abf8 Permit subsequent conditional requests on 304

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jun 27 17:05:09 UTC 2019


commit 57941abf81ba089c6530666cd6309886a9361073
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Thu Dec 27 17:10:20 2018 +0000

    Permit subsequent conditional requests on 304
    
    Fixes #2871.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index ad44b3041..a5701ec8e 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -714,7 +714,8 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
 		    OA_ESIDATA));
 
 	AZ(ObjCopyAttr(bo->wrk, bo->fetch_objcore, bo->stale_oc, OA_FLAGS));
-	ObjSetFlag(bo->wrk, bo->fetch_objcore, OF_IMSCAND, 0);
+	if (bo->fetch_objcore->flags & OC_F_HFM)
+		ObjSetFlag(bo->wrk, bo->fetch_objcore, OF_IMSCAND, 0);
 	AZ(ObjCopyAttr(bo->wrk, bo->fetch_objcore, bo->stale_oc, OA_GZIPBITS));
 
 	if (bo->do_stream) {
diff --git a/bin/varnishtest/tests/b00039.vtc b/bin/varnishtest/tests/b00039.vtc
index b9d40bfeb..ba4285369 100644
--- a/bin/varnishtest/tests/b00039.vtc
+++ b/bin/varnishtest/tests/b00039.vtc
@@ -6,6 +6,9 @@ server s1 {
 	rxreq
 	expect req.http.if-modified-since == "Wed, 11 Sep 2013 13:36:55 GMT"
 	txresp -status 304
+	rxreq
+	expect req.http.if-modified-since == "Wed, 11 Sep 2013 13:36:55 GMT"
+	txresp -status 304
 } -start
 
 varnish v1 -vcl+backend {
@@ -44,3 +47,13 @@ client c1 {
 	expect resp.body == "Geoff Rules"
 	expect resp.http.was-304 == "true"
 } -run
+
+delay 1
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.status == 200
+	expect resp.body == "Geoff Rules"
+	expect resp.http.was-304 == "true"
+} -run


More information about the varnish-commit mailing list