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) ...@@ -348,6 +348,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
VTAILQ_FOREACH(oc, &oh->objcs, list) { VTAILQ_FOREACH(oc, &oh->objcs, list) {
/* Must be at least our own ref + the objcore we examine */ /* Must be at least our own ref + the objcore we examine */
assert(oh->refcnt > 1); assert(oh->refcnt > 1);
assert(oc->objhead == oh);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
if (oc->flags & OC_F_PERSISTENT) if (oc->flags & OC_F_PERSISTENT)
...@@ -405,6 +406,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh) ...@@ -405,6 +406,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
if (oc != NULL) { if (oc != NULL) {
o = oc->obj; o = oc->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
assert(oc->objhead == oh);
/* We found an object we like */ /* We found an object we like */
o->refcnt++; o->refcnt++;
...@@ -438,6 +440,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh) ...@@ -438,6 +440,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
/* XXX: Should this not be ..._HEAD now ? */ /* XXX: Should this not be ..._HEAD now ? */
VTAILQ_INSERT_TAIL(&oh->objcs, oc, list); VTAILQ_INSERT_TAIL(&oh->objcs, oc, list);
oc->objhead = oh;
/* NB: do not deref objhead the new object inherits our reference */ /* NB: do not deref objhead the new object inherits our reference */
Lck_Unlock(&oh->mtx); Lck_Unlock(&oh->mtx);
*poh = oh; *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