Fix for bug 121952 -- make PR_ConnectContinue work on Mac, re-enabling non-blocking connects. r=wtc

git-svn-id: svn://10.0.0.236/trunk@114854 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com
2002-02-19 01:10:06 +00:00
parent ebb6dc6f70
commit c068f535fe

View File

@@ -800,36 +800,14 @@ nsSSLIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr,
return PR_FAILURE;
PRStatus status = PR_SUCCESS;
#ifdef XP_MAC // bug 106188
// Due to a bug in PR_Poll on Mac, we must execute this entire connect
// as a blocking operation.
PRSocketOptionData sockopt;
sockopt.option = PR_SockOpt_Nonblocking;
PR_GetSocketOption(fd, &sockopt);
PRBool oldBlockVal = sockopt.value.non_blocking;
sockopt.option = PR_SockOpt_Nonblocking;
sockopt.value.non_blocking = PR_FALSE;
PR_SetSocketOption(fd, &sockopt);
#endif
nsNSSSocketInfo *infoObject = (nsNSSSocketInfo*)fd->secret;
status = fd->lower->methods->connect(fd->lower, addr,
#ifdef XP_MAC // bug 106188
PR_INTERVAL_NO_TIMEOUT);
#else
timeout);
#endif
status = fd->lower->methods->connect(fd->lower, addr, timeout);
if (status != PR_SUCCESS) {
PR_LOG(gPIPNSSLog, PR_LOG_ERROR, ("[%p] Lower layer connect error: %d\n",
(void*)fd, PR_GetError()));
#ifdef XP_MAC // bug 106188
goto loser;
#else
return status;
#endif
}
PRBool forceHandshake, forTLSStepUp;
@@ -850,16 +828,6 @@ nsSSLIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr,
}
}
#ifdef XP_MAC // bug 106188
loser:
// We put the Nonblocking bit back to the value it was when
// we entered this function.
NS_ASSERTION(sockopt.option == PR_SockOpt_Nonblocking,
"sockopt.option was re-set to an unexpected value");
sockopt.value.non_blocking = oldBlockVal;
PR_SetSocketOption(fd, &sockopt);
#endif
return status;
}