STABLE14-windows-remove-active_vcp-20060410

The 'active_vcp' variable is no longer being used for any useful
purpose and is the center of a race condition that could lead to
an undercount of references to 'vcp' objects.  Remove it.


(cherry picked from commit f1ef60c020feffb73b2aee4c1871afba039afb67)
This commit is contained in:
Jeffrey Altman 2006-04-10 18:56:30 +00:00
parent 26d813f1c7
commit de60742535

View File

@ -38,8 +38,6 @@
static char *illegalChars = "\\/:*?\"<>|"; static char *illegalChars = "\\/:*?\"<>|";
BOOL isWindows2000 = FALSE; BOOL isWindows2000 = FALSE;
smb_vc_t *active_vcp = NULL;
int smbShutdownFlag = 0; int smbShutdownFlag = 0;
int smb_LogoffTokenTransfer; int smb_LogoffTokenTransfer;
@ -7342,25 +7340,6 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
smb_SendPacket(vcp, outp); smb_SendPacket(vcp, outp);
thrd_Decrement(&ongoingOps); thrd_Decrement(&ongoingOps);
if (!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
if (active_vcp != vcp) {
if (active_vcp) {
osi_Log2(smb_logp,
"Replacing active_vcp %x with %x", active_vcp, vcp);
smb_ReleaseVC(active_vcp);
}
smb_HoldVC(vcp);
lock_ObtainWrite(&smb_globalLock);
active_vcp = vcp;
lock_ReleaseWrite(&smb_globalLock);
}
last_msg_time = GetTickCount();
} else if (active_vcp == vcp) { /* the vcp is dead */
smb_ReleaseVC(active_vcp);
lock_ObtainWrite(&smb_globalLock);
active_vcp = NULL;
lock_ReleaseWrite(&smb_globalLock);
}
return; return;
} }