Commit 27e11399 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move some asserts up in the code, to catch Kristians panic.

parent d0dce476
......@@ -1005,8 +1005,8 @@ AssertObjBusy(const struct object *o)
}
static inline void
AssertObjPassOrBusy(const struct object *o)
AssertObjCorePassOrBusy(const struct objcore *oc)
{
if (o->objcore != NULL)
AN (o->objcore->flags & OC_F_BUSY);
if (oc != NULL)
AN (oc->flags & OC_F_BUSY);
}
......@@ -578,6 +578,7 @@ cnt_fetch(struct sess *sp)
sp->step = STP_FETCHBODY;
return (0);
case VCL_RET_DELIVER:
AssertObjCorePassOrBusy(sp->objcore);
sp->step = STP_FETCHBODY;
return (0);
default:
......@@ -817,6 +818,7 @@ cnt_fetchbody(struct sess *sp)
sp->wrk->do_stream = 0;
if (sp->wrk->do_stream) {
AssertObjCorePassOrBusy(sp->obj->objcore);
sp->step = STP_PREPRESP;
return (0);
}
......
......@@ -496,7 +496,7 @@ FetchBody(struct sess *sp)
sp->wrk->vfp = &vfp_nop;
AN(sp->director);
AssertObjPassOrBusy(sp->obj);
AssertObjCorePassOrBusy(sp->obj->objcore);
AZ(sp->wrk->vgz_rx);
AZ(VTAILQ_FIRST(&sp->obj->store));
......
......@@ -588,7 +588,7 @@ HSH_Drop(struct sess *sp)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
o = sp->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
AssertObjPassOrBusy(o);
AssertObjCorePassOrBusy(o->objcore);
o->exp.ttl = -1.;
if (o->objcore != NULL) /* Pass has no objcore */
HSH_Unbusy(sp);
......
......@@ -57,7 +57,7 @@
*/
static struct vsb vsps, *vsp;
pthread_mutex_t panicstr_mtx = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t panicstr_mtx = PTHREAD_MUTEX_INITIALIZER;
/*--------------------------------------------------------------------*/
......
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