Bug 1239655 - Do not do PR_ConnectContinue during the shutdown. r=mcmanus

This commit is contained in:
Dragana Damjanovic 2016-01-14 08:53:00 -05:00
Родитель 466b5fb4c9
Коммит c03ef33b0d
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -1886,7 +1886,9 @@ nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags)
// Update poll timeout in case it was changed // Update poll timeout in case it was changed
mPollTimeout = mTimeouts[TIMEOUT_READ_WRITE]; mPollTimeout = mTimeouts[TIMEOUT_READ_WRITE];
} }
else if (mState == STATE_CONNECTING) { else if ((mState == STATE_CONNECTING) && !gIOService->IsNetTearingDown()) {
// We do not need to do PR_ConnectContinue when we are already
// shutting down.
// We use PRIntervalTime here because we need // We use PRIntervalTime here because we need
// nsIOService::LastOfflineStateChange time and // nsIOService::LastOfflineStateChange time and
@ -1959,6 +1961,13 @@ nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags)
} }
} }
} }
else if ((mState == STATE_CONNECTING) && gIOService->IsNetTearingDown()) {
// We do not need to do PR_ConnectContinue when we are already
// shutting down.
SOCKET_LOG(("We are in shutdown so skip PR_ConnectContinue and set "
"and error.\n"));
mCondition = NS_ERROR_ABORT;
}
else { else {
NS_ERROR("unexpected socket state"); NS_ERROR("unexpected socket state");
mCondition = NS_ERROR_UNEXPECTED; mCondition = NS_ERROR_UNEXPECTED;