[master] 0302e16 Expire superseded objects also if they are no IMS/INM candidates
Nils Goroll
nils.goroll at uplex.de
Wed Jan 7 16:53:43 CET 2015
commit 0302e16e8888d9213931077b9b331f72dcc018b6
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Jan 7 16:53:17 2015 +0100
Expire superseded objects also if they are no IMS/INM candidates
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index e0c6941..8fca585 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -192,7 +192,8 @@ vbf_stp_mkbereq(const struct worker *wrk, struct busyobj *bo)
http_CopyHome(bo->bereq0);
}
- if (bo->ims_oc != NULL) {
+ if (bo->ims_oc != NULL &&
+ ObjCheckFlag(bo->wrk, bo->ims_oc, OF_IMSCAND)) {
q = HTTP_GetHdrPack(bo->wrk, bo->ims_oc, H_Last_Modified);
if (q != NULL)
http_PrintfHeader(bo->bereq0,
@@ -974,7 +975,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
bo->fetch_objcore = oc;
AZ(bo->ims_oc);
- if (oldoc != NULL && ObjCheckFlag(req->wrk, oldoc, OF_IMSCAND)) {
+ if (oldoc != NULL) {
assert(oldoc->refcnt > 0);
HSH_Ref(oldoc);
bo->ims_oc = oldoc;
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