DEVEL15-windows-multi-check-servers-20080206

LICENSE MIT

do not leak references

remove signed vs unsigned warnings

retry all RXGEN_OPCODE responses regardless of whether or not the entry
had to be moved to consolidate the list.


(cherry picked from commit 5d61f37949fd561f4c9d777cc67c5fd3db835e29)
This commit is contained in:
Jeffrey Altman 2008-02-06 19:31:09 +00:00
parent 92dedcce01
commit 0222fceb6f

View File

@ -273,10 +273,9 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
int srvAddrCount = 0;
struct srvAddr **addrs = NULL;
cm_conn_t **conns = NULL;
int nconns = 0;
struct rx_connection **rxconns = NULL;
cm_req_t req;
afs_uint32 i, j;
afs_int32 i, j, nconns = 0;
afs_int32 *conntimer, *results;
Capabilities *caps = NULL;
cm_server_t ** serversp, *tsp;
@ -300,7 +299,9 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
memset(caps, 0, j * sizeof(Capabilities));
if (!(flags & CM_FLAG_CHECKVLDBSERVERS)) {
if ((flags & CM_FLAG_CHECKFILESERVERS) ||
!(flags & (CM_FLAG_CHECKFILESERVERS|CM_FLAG_CHECKVLDBSERVERS)))
{
lock_ObtainWrite(&cm_serverLock);
nconns = 0;
for (nconns=0, tsp = cm_allServersp; tsp; tsp = tsp->allNextp) {
@ -465,10 +466,12 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
* that RXAFS_GetCapabilities is not supported.
*/
for ( i=0, j=0; i<nconns; i++) {
if (results[i] == RXGEN_OPCODE && i != j) {
conns[j] = conns[i];
rxconns[j] = rxconns[i];
serversp[j] = serversp[i];
if (results[i] == RXGEN_OPCODE) {
if (i != j) {
conns[j] = conns[i];
rxconns[j] = rxconns[i];
serversp[j] = serversp[i];
}
j++;
}
}
@ -585,7 +588,9 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
}
}
if (!(flags & CM_FLAG_CHECKFILESERVERS)) {
if ((flags & CM_FLAG_CHECKVLDBSERVERS) ||
!(flags & (CM_FLAG_CHECKFILESERVERS|CM_FLAG_CHECKVLDBSERVERS)))
{
lock_ObtainWrite(&cm_serverLock);
nconns = 0;
for (nconns=0, tsp = cm_allServersp; tsp; tsp = tsp->allNextp) {
@ -620,7 +625,8 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
}
lock_ObtainWrite(&cm_serverLock);
rxconns[nconns] = cm_GetRxConn(conns[nconns]);
if (conntimer[nconns] = (isDown ? 1 : 0))
conntimer[nconns] = (isDown ? 1 : 0);
if (isDown)
rx_SetConnDeadTime(rxconns[nconns], 10);
nconns++;
@ -638,10 +644,6 @@ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
/* Process results of servers that support RXAFS_GetCapabilities */
for (i=0; i<nconns; i++) {
/* Leave the servers that did not support GetCapabilities alone */
if (results[i] == RXGEN_OPCODE)
continue;
if (conntimer[i])
rx_SetConnDeadTime(rxconns[i], ConnDeadtimeout);
rx_PutConnection(rxconns[i]);