Bug 700402 - ABORT: syntimer not null, creting SYN retry timer after connection manager shutdown, r=mcmanus

This commit is contained in:
Honza Bambas 2011-11-08 11:56:46 +01:00
Родитель 9c37656296
Коммит 8bac226218
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -1491,6 +1491,9 @@ nsHttpConnectionMgr::nsHalfOpenSocket::Abandon()
{ {
LOG(("nsHalfOpenSocket::Abandon [this=%p ent=%s]", LOG(("nsHalfOpenSocket::Abandon [this=%p ent=%s]",
this, mEnt->mConnInfo->Host())); this, mEnt->mConnInfo->Host()));
NS_ABORT_IF_FALSE(PR_GetCurrentThread() == gSocketThread, "wrong thread");
nsRefPtr<nsHalfOpenSocket> deleteProtector(this); nsRefPtr<nsHalfOpenSocket> deleteProtector(this);
if (mStreamOut) { if (mStreamOut) {
@ -1627,8 +1630,14 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans,
switch (status) { switch (status) {
case nsISocketTransport::STATUS_CONNECTING_TO: case nsISocketTransport::STATUS_CONNECTING_TO:
// Passed DNS resolution, now trying to connect, start the backup timer // Passed DNS resolution, now trying to connect, start the backup timer
// only prevent creating another backup transport // only prevent creating another backup transport.
if (!mBackupTransport && !mSynTimer) // We also check for mEnt presence to not instantiate the timer after
// this half open socket has already been abandoned. It may happen
// when we get this notification right between main-thread calls to
// nsHttpConnectionMgr::Shutdown and nsSocketTransportService::Shutdown
// where the first abandones all half open socket instances and only
// after that the second stops the socket thread.
if (mEnt && !mBackupTransport && !mSynTimer)
SetupBackupTimer(); SetupBackupTimer();
break; break;