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.
This commit is contained in:
Nickolai Zeldovich 2002-01-21 18:05:26 +00:00 committed by Derrick Brashear
parent 5bf04219f5
commit 7806d0a7d5

View File

@ -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; i<RX_MAXCALLS; i++) {
struct rx_call *call = conn->call[i];
if (call) {