r5542 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Mon Nov 15 12:23:04 CET 2010


Author: phk
Date: 2010-11-15 12:23:04 +0100 (Mon, 15 Nov 2010)
New Revision: 5542

Modified:
   trunk/varnish-cache/bin/varnishd/cache_expire.c
   trunk/varnish-cache/bin/varnishd/cache_hash.c
Log:
HSH_DerefObjCore() should never be called (currently) on an objcore
with a valid obj.



Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2010-11-15 11:11:52 UTC (rev 5541)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2010-11-15 11:23:04 UTC (rev 5542)
@@ -298,6 +298,9 @@
 		} else {
 			WSL(sp->wrk, SLT_ExpKill, 1, "-1 %d",
 			    (int)(oc->timer_when - t));
+
+			/* XXX: Should we tell -spersistent ? */
+			oc->obj = NULL;
 			HSH_DerefObjCore(sp->wrk, oc);
 			sp->wrk->stats.n_vampireobject--;
 		}

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-11-15 11:11:52 UTC (rev 5541)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-11-15 11:23:04 UTC (rev 5542)
@@ -629,6 +629,8 @@
 	oh = oc->objhead;
 	CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
 
+	AZ(oc->obj);
+
 	Lck_Lock(&oh->mtx);
 	VTAILQ_REMOVE(&oh->objcs, oc, list);
 	if (oc->flags & OC_F_BUSY)




More information about the varnish-commit mailing list