[master] aeebcb5 Only grab the extra reference if we have a request thread that wants it.

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 5 22:14:48 CET 2014


commit aeebcb565a4dfe4e2c3f720e5428b7b78bd0686a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 5 21:13:54 2014 +0000

    Only grab the extra reference if we have a request thread that wants it.
    
    Zeroed in on by:	scoof

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index fa58309..c6514fd 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -780,9 +780,11 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
 	bo->vary = req->vary_b;
 	req->vary_b = NULL;
 
-	HSH_Ref(oc);
+	if (mode != VBF_BACKGROUND)
+		HSH_Ref(oc);
 	bo->fetch_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)) {



More information about the varnish-commit mailing list