Fix blocker bug 121326 (any SSL transaction causes Mac to freeze) by checking in temporary patch from bug 106188; this reverts Mac to using blocking connects. r=wtc.
git-svn-id: svn://10.0.0.236/trunk@113058 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
8fd7000045
commit
be543daf3c
@ -801,14 +801,35 @@ nsSSLIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr,
|
||||
|
||||
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
|
||||
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;
|
||||
@ -829,6 +850,16 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user