Commit a4f30d7e authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Don't try to lock the objhead mutex if we don't have an objhead. Doing so

caused the Varnish child to die immediately after sending its 503 response
if the backend didn't respond.

Reviewed by:	phk


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1376 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent d61eaebd
......@@ -185,6 +185,7 @@ HSH_Lookup(struct sess *sp)
void
HSH_Unbusy(struct object *o)
{
struct objhead *oh;
struct sess *sp;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
......@@ -192,9 +193,14 @@ HSH_Unbusy(struct object *o)
assert(o->refcnt > 0);
if (o->cacheable)
EXP_Insert(o);
LOCK(&o->objhead->mtx);
oh = o->objhead;
if (oh != NULL) {
CHECK_OBJ(oh, OBJHEAD_MAGIC);
LOCK(&oh->mtx);
}
o->busy = 0;
UNLOCK(&o->objhead->mtx);
if (oh != NULL)
UNLOCK(&oh->mtx);
while (1) {
sp = TAILQ_FIRST(&o->waitinglist);
if (sp == NULL)
......
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