* We base our values on those while making sure we leave
* enough time for overhead.
*/
- if (ConnDeadtimeout == 0) {
- ConnDeadtimeout = (unsigned short) ((RDRtimeout / 2) < 50 ? (RDRtimeout / 2) : 50);
- afsi_log("ConnDeadTimeout is %d", ConnDeadtimeout);
- }
- if (HardDeadtimeout == 0) {
- HardDeadtimeout = (unsigned short) (RDRtimeout > 125 ? 120 : (RDRtimeout - 5));
- afsi_log("HardDeadTimeout is %d", HardDeadtimeout);
- }
- if (IdleDeadtimeout == 0) {
- IdleDeadtimeout = (unsigned short) ConnDeadtimeout;
- afsi_log("IdleDeadTimeout is %d", IdleDeadtimeout);
+ if (smb_Enabled) {
+ afsi_log("lanmanworkstation : SessTimeout %u", RDRtimeout);
+ if (ConnDeadtimeout == 0) {
+ ConnDeadtimeout = (unsigned short) ((RDRtimeout / 2) < 50 ? (RDRtimeout / 2) : 50);
+ afsi_log("ConnDeadTimeout is %d", ConnDeadtimeout);
+ }
+ if (HardDeadtimeout == 0) {
+ HardDeadtimeout = (unsigned short) (RDRtimeout > 125 ? 120 : (RDRtimeout - 5));
+ afsi_log("HardDeadTimeout is %d", HardDeadtimeout);
+ }
+ if (IdleDeadtimeout == 0) {
+ IdleDeadtimeout = (unsigned short) ConnDeadtimeout;
+ afsi_log("IdleDeadTimeout is %d", IdleDeadtimeout);
+ }
+ } else {
+ if (ConnDeadtimeout == 0) {
+ ConnDeadtimeout = CM_CONN_IFS_CONNDEADTIME;
+ afsi_log("ConnDeadTimeout is %d", ConnDeadtimeout);
+ }
+ if (HardDeadtimeout == 0) {
+ HardDeadtimeout = CM_CONN_IFS_HARDDEADTIME;
+ afsi_log("HardDeadTimeout is %d", HardDeadtimeout);
+ }
+ if (IdleDeadtimeout == 0) {
+ IdleDeadtimeout = CM_CONN_IFS_IDLEDEADTIME;
+ afsi_log("IdleDeadTimeout is %d", IdleDeadtimeout);
+ }
}
osi_EndOnce(&once);
}
/* timeleft - get it from reqp the same way as cm_ConnByMServers does */
timeUsed = (GetTickCount() - reqp->startTime) / 1000;
- timeLeft = HardDeadtimeout - timeUsed;
+ if ( reqp->flags & CM_REQ_SOURCE_SMB )
+ timeLeft = HardDeadtimeout - timeUsed;
+ else
+ timeLeft = 0x0FFFFFFF;
/* get a pointer to the cell */
if (errorCode) {
pscp = cm_FindSCacheParent(scp);
lock_ObtainWrite(&scp->rw);
+ scp->flags |= CM_SCACHEFLAG_DELETED;
lock_ObtainWrite(&cm_scacheLock);
- cm_RemoveSCacheFromHashTable(scp);
+ cm_AdjustScacheLRU(scp);
+ cm_RemoveSCacheFromHashTable(scp);
lock_ReleaseWrite(&cm_scacheLock);
cm_LockMarkSCacheLost(scp);
- scp->flags |= CM_SCACHEFLAG_DELETED;
lock_ReleaseWrite(&scp->rw);
cm_ReleaseSCache(scp);
if (errorCode == RX_CALL_DEAD &&
(reqp->flags & CM_REQ_NEW_CONN_FORCED)) {
if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
- serverp->flags |= CM_SERVERFLAG_DOWN;
+ _InterlockedOr(&serverp->flags, CM_SERVERFLAG_DOWN);
serverp->downTime = time(NULL);
}
} else {
free(ucellp->ticketp);
ucellp->ticketp = NULL;
}
- ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
+ _InterlockedAnd(&ucellp->flags, ~CM_UCELLFLAG_RXKAD);
ucellp->gen++;
lock_ReleaseMutex(&userp->mx);
if ( timeLeft > 2 )