Commit a88f7b4b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

New objcore's didn't get a pointer set to their objhead.

Add a couple of asserts to check that they all do now.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4491 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 90f2bbaf
......@@ -348,6 +348,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
VTAILQ_FOREACH(oc, &oh->objcs, list) {
/* Must be at least our own ref + the objcore we examine */
assert(oh->refcnt > 1);
assert(oc->objhead == oh);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
if (oc->flags & OC_F_PERSISTENT)
......@@ -405,6 +406,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
if (oc != NULL) {
o = oc->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
assert(oc->objhead == oh);
/* We found an object we like */
o->refcnt++;
......@@ -438,6 +440,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
/* XXX: Should this not be ..._HEAD now ? */
VTAILQ_INSERT_TAIL(&oh->objcs, oc, list);
oc->objhead = oh;
/* NB: do not deref objhead the new object inherits our reference */
Lck_Unlock(&oh->mtx);
*poh = oh;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment