[4.0] 412d148 Expire superseded objects also if they are no IMS/INM candidates
Lasse Karstensen
lkarsten at varnish-software.com
Wed Feb 11 13:29:02 CET 2015
commit 412d148583f07da73d34e298f84fa6d36df0b94b
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Feb 4 16:51:30 2015 +0100
Expire superseded objects also if they are no IMS/INM candidates
Conflicts:
bin/varnishd/cache/cache_fetch.c
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index f87c1bd..0370bab 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -939,12 +939,9 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
AZ(bo->ims_obj);
if (oldobj != NULL) {
- if (http_GetHdr(oldobj->http, H_Last_Modified, NULL) ||
- http_GetHdr(oldobj->http, H_ETag, NULL)) {
- assert(oldobj->objcore->refcnt > 0);
- HSH_Ref(oldobj->objcore);
- bo->ims_obj = oldobj;
- }
+ assert(oldobj->objcore->refcnt > 0);
+ HSH_Ref(oldobj->objcore);
+ bo->ims_obj = oldobj;
}
AZ(bo->req);
diff --git a/bin/varnishtest/tests/c00058.vtc b/bin/varnishtest/tests/c00058.vtc
index 440bbf3..8c9940b 100644
--- a/bin/varnishtest/tests/c00058.vtc
+++ b/bin/varnishtest/tests/c00058.vtc
@@ -22,7 +22,11 @@ client c1 {
expect resp.bodylen == 3
delay 1
+} -run
+
+varnish v1 -expect n_object == 1
+client c1 {
# We still get old object
txreq
rxresp
@@ -37,3 +41,6 @@ client c1 {
rxresp
expect resp.bodylen == 6
} -run
+
+# and the old one has got superseded
+varnish v1 -expect n_object == 1
More information about the varnish-commit
mailing list