From 547a9c1391e2e286f0be2af127b804dbda3b22d8 Mon Sep 17 00:00:00 2001 Message-Id: <547a9c1391e2e286f0be2af127b804dbda3b22d8.1716650275.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 1 Jan 2007 12:52:32 +0000 Subject: [PATCH] admin: Fix premature close in a_bgrelease. Organization: Straylight/Edgeware From: Mark Wooding The function incorrectly destroys the connection at the release of the first background job after close; it should wait until they've all finished. --- server/admin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/admin.c b/server/admin.c index ca5dc8cf..7a932ad1 100644 --- a/server/admin.c +++ b/server/admin.c @@ -641,7 +641,7 @@ static void a_bgrelease(admin_bgop *bg) if (bg->prev) bg->prev->next = bg->next; else a->bg = bg->next; xfree(bg); - if (a->f & AF_CLOSE) a_destroy(a); + if (!a->bg && (a->f & AF_CLOSE)) a_destroy(a); } /* --- @a_bgok@, @a_bginfo@, @a_bgfail@ --- * -- [mdw]