else if (errorCode == VNOVOL || errorCode == VMOVED || errorCode == VOFFLINE ||
errorCode == VSALVAGE || errorCode == VNOSERVICE || errorCode == VIO)
{
- char addr[16];
char *format;
DWORD msgID;
}
else if (errorCode >= -64 && errorCode < 0) {
/* mark server as down */
- sprintf(addr, "%d.%d.%d.%d",
+ sprintf(addr, "%d.%d.%d.%d",
((serverp->addr.sin_addr.s_addr & 0xff)),
((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
- ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24));
+ ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24));
if (errorCode == RX_CALL_DEAD)
osi_Log2(afsd_logp, "cm_Analyze: Rx Call Dead addr[%s] forcedNew[%s]",
(reqp->flags & CM_REQ_NEW_CONN_FORCED ? "yes" : "no"));
lock_ObtainMutex(&serverp->mx);
- if (errorCode != RX_CALL_DEAD ||
+ if (errorCode == RX_CALL_DEAD &&
(reqp->flags & CM_REQ_NEW_CONN_FORCED)) {
if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
serverp->flags |= CM_SERVERFLAG_DOWN;
serverp->downTime = time(NULL);
}
} else {
- reqp->flags |= CM_REQ_NEW_CONN_FORCED;
- forcing_new = 1;
+ if (reqp->flags & CM_REQ_NEW_CONN_FORCED) {
+ reqp->tokenIdleErrorServp = serverp;
+ reqp->tokenError = errorCode;
+ } else {
+ reqp->flags |= CM_REQ_NEW_CONN_FORCED;
+ forcing_new = 1;
+ }
}
lock_ReleaseMutex(&serverp->mx);
cm_ForceNewConnections(serverp);
temp = rx_Write(rxcallp, bufferp, wbytes);
if (temp != wbytes) {
osi_Log3(afsd_logp, "rx_Write failed bp 0x%p, %d != %d",bufp,temp,wbytes);
- code = -1;
+ code = (rxcallp->error < 0) ? rxcallp->error : RX_PROTOCOL_ERROR;
break;
} else {
osi_Log2(afsd_logp, "rx_Write succeeded bp 0x%p, %d",bufp,temp);
if (temp == sizeof(afs_int32)) {
nbytes = ntohl(nbytes);
FillInt64(length_found, nbytes_hi, nbytes);
- if (length_found > biod.length)
- code = (rxcallp->error < 0) ? rxcallp->error : -1;
+ if (length_found > biod.length) {
+ osi_Log0(afsd_logp, "cm_GetBuffer length_found > biod.length");
+ code = (rxcallp->error < 0) ? rxcallp->error : RX_PROTOCOL_ERROR;
+ }
} else {
- code = (rxcallp->error < 0) ? rxcallp->error : -1;
+ osi_Log1(afsd_logp, "cm_GetBuffer rx_Read32 returns %d != 4", temp);
+ code = (rxcallp->error < 0) ? rxcallp->error : RX_PROTOCOL_ERROR;
}
}
/* for the moment, nbytes_hi will always be 0 if code == 0
temp = rx_Read32(rxcallp, &nbytes);
if (temp == sizeof(afs_int32)) {
nbytes = ntohl(nbytes);
- if (nbytes > biod.length)
- code = (rxcallp->error < 0) ? rxcallp->error : -1;
+ if (nbytes > biod.length) {
+ osi_Log0(afsd_logp, "cm_GetBuffer length_found > biod.length");
+ code = (rxcallp->error < 0) ? rxcallp->error : RX_PROTOCOL_ERROR;
+ }
+ }
+ else {
+ osi_Log1(afsd_logp, "cm_GetBuffer rx_Read32 returns %d != 4", temp);
+ code = (rxcallp->error < 0) ? rxcallp->error : RX_PROTOCOL_ERROR;
}
- else
- code = (rxcallp->error < 0) ? rxcallp->error : -1;
}
#endif
rbytes = (nbytes > cm_data.buf_blockSize? cm_data.buf_blockSize : nbytes);
temp = rx_Read(rxcallp, bufferp, rbytes);
if (temp < rbytes) {
- code = (rxcallp->error < 0) ? rxcallp->error : -1;
+ code = (rxcallp->error < 0) ? rxcallp->error : RX_EOF;
break;
}