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