attempt to fix stalling of imap urls due to race condition in url chaining, r=ducarroz, sr=sspitzer, a=asa 182808

This commit is contained in:
bienvenu%netscape.com 2002-12-09 20:03:43 +00:00
parent fb86bcba83
commit 596d8eaa46
2 changed files with 6 additions and 3 deletions

View File

@ -465,6 +465,9 @@ nsImapIncomingServer::GetImapConnectionAndLoadUrl(nsIEventQueue * aClientEventQu
m_urlConsumers.AppendElement((void*)aConsumer);
NS_IF_ADDREF(aConsumer);
PR_CExitMonitor(this);
// let's try running it now - maybe the connection is free now.
PRBool urlRun;
rv = LoadNextQueuedUrl(&urlRun);
}
return rv;

View File

@ -838,6 +838,7 @@ void nsImapProtocol::ReleaseUrlState()
m_mockChannel->Close();
m_mockChannel = nsnull;
}
m_channelContext = nsnull; // this might be the url - null it out before the final release of the url
if (m_runningUrl)
{
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsurl = do_QueryInterface(m_runningUrl);
@ -868,7 +869,6 @@ void nsImapProtocol::ReleaseUrlState()
m_imapExtensionSink = nsnull;
m_imapMiscellaneousSink = nsnull;
m_channelListener = nsnull;
m_channelContext = nsnull;
m_channelInputStream = nsnull;
m_channelOutputStream = nsnull;
@ -1369,8 +1369,6 @@ PRBool nsImapProtocol::ProcessCurrentURL()
// release the url as we are done with it...
ReleaseUrlState();
ResetProgressInfo();
m_urlInProgress = PR_FALSE;
ClearFlag(IMAP_CLEAN_UP_URL_STATE);
if (GetConnectionStatus() >= 0 && imapMailFolderSink)
{
@ -1386,6 +1384,8 @@ PRBool nsImapProtocol::ProcessCurrentURL()
{
if (GetConnectionStatus() >= 0)
{
ClearFlag(IMAP_CLEAN_UP_URL_STATE);
m_urlInProgress = PR_FALSE;
rv = m_imapServerSink->LoadNextQueuedUrl(&anotherUrlRun);
SetFlag(IMAP_FIRST_PASS_IN_THREAD);
}