From 7806d0a7d5d3cc74ec692f3cd5dcc5d91c614d79 Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Mon, 21 Jan 2002 18:05:26 +0000 Subject: [PATCH] rx-cleanup-deadlock-and-refcnt-leak-20020121 The first part of the patch fixes a likely deadlock in the case when we're destroying a client connection with active calls. The second part fixes a minor connection refcount leak in my recent modification to protect against half-reachable clients. --- src/rx/rx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 0e5df40465..cbec10e765 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -899,7 +899,7 @@ static void rxi_DestroyConnectionNoLock(conn) RX_CALL_REFCOUNT_DELAY); if (call->state == RX_STATE_PRECALL || call->state == RX_STATE_ACTIVE) { - rxi_SendDelayedAck(call->delayedAckEvent, call, 0); + rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0); } else { rxi_AckAll((struct rxevent *)0, call, 0); } @@ -4285,12 +4285,15 @@ void rxi_ConnectionError(conn, error) { if (error) { register int i; + MUTEX_ENTER(&conn->conn_data_lock); if (conn->challengeEvent) rxevent_Cancel(conn->challengeEvent, (struct rx_call*)0, 0); if (conn->checkReachEvent) { rxevent_Cancel(conn->checkReachEvent, (struct rx_call*)0, 0); conn->checkReachEvent = 0; + conn->refCount--; } + MUTEX_EXIT(&conn->conn_data_lock); for (i=0; icall[i]; if (call) {