client->CPS.prlist_val = NULL;
if (client->tcon) {
rx_SetSpecific(client->tcon, rxcon_client_key, (void *)0);
+ rx_PutConnection(client->tcon);
}
CurrentConnections--;
*cp = client->next;
* destroying the connection.
*/
client = rx_GetSpecific(rxconn, rxcon_client_key);
- if (client && client->tcon == rxconn)
+ if (client && client->tcon == rxconn) {
+ rx_PutConnection(client->tcon);
client->tcon = NULL;
+ }
rx_SetSpecific(rxconn, rxcon_client_key, (void *)0);
rx_DestroyConnection(rxconn);
}
client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
if (client) {
H_LOCK;
- if (client->tcon == tcon)
+ if (client->tcon == tcon) {
+ rx_PutConnection(client->tcon);
client->tcon = NULL;
+ }
H_UNLOCK;
}
return 0;
(struct client *)rx_GetSpecific(client->tcon,
rxcon_client_key);
if (oldClient) {
- if (oldClient == client)
+ if (oldClient == client) {
rx_SetSpecific(client->tcon, rxcon_client_key,
NULL);
- else
+ } else
ViceLog(0,
("Client-conn mismatch: CL1=%x, CN=%x, CL2=%x\n",
client, client->tcon, oldClient));
}
+ rx_PutConnection(client->tcon);
client->tcon = (struct rx_connection *)0;
}
client->refCount++;
oldClient->refCount++;
client = oldClient;
} else {
+ rx_PutConnection(oldClient->tcon);
oldClient->tcon = (struct rx_connection *)0;
ViceLog(0, ("FindClient: deleted client %x(%x) already had conn %x (host %s:%d), stolen by client %x(%x)\n",
oldClient, oldClient->sid, tcon,
h_Unlock_r(host);
CurrentConnections++; /* increment number of connections */
}
+ rx_GetConnection(tcon);
client->tcon = tcon;
rx_SetSpecific(tcon, rxcon_client_key, client);
ReleaseWriteLock(&client->lock);