b=180806 IMAP backend should avoid unnecessary logout

r=bienvenu sr=sspitzer
This commit is contained in:
kaie%netscape.com 2002-11-28 18:36:36 +00:00
Родитель 210417ee19
Коммит 20efdc8b4f
1 изменённых файлов: 20 добавлений и 17 удалений

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

@ -1000,25 +1000,28 @@ nsImapProtocol::TellThreadToDie(PRBool isSaveToClose)
nsresult rv = NS_OK;
PRUint32 writeCount;
if (closeNeeded && GetDeleteIsMoveToTrash() &&
TestFlag(IMAP_CONNECTION_IS_OPEN) && m_outputStream)
if (m_currentServerCommandTagNumber > 0)
{
IncrementCommandTagNumber();
command = GetServerCommandTag();
command.Append(" close" CRLF);
rv = m_outputStream->Write(command.get(), command.Length(),
&writeCount);
Log("SendData", "TellThreadToDie", command.get());
}
if (closeNeeded && GetDeleteIsMoveToTrash() &&
TestFlag(IMAP_CONNECTION_IS_OPEN) && m_outputStream)
{
IncrementCommandTagNumber();
command = GetServerCommandTag();
command.Append(" close" CRLF);
rv = m_outputStream->Write(command.get(), command.Length(),
&writeCount);
Log("SendData", "TellThreadToDie", command.get());
}
if (NS_SUCCEEDED(rv) && TestFlag(IMAP_CONNECTION_IS_OPEN) && m_outputStream)
{
IncrementCommandTagNumber();
command = GetServerCommandTag();
command.Append(" logout" CRLF);
rv = m_outputStream->Write(command.get(), command.Length(),
&writeCount);
Log("SendData", "TellThreadToDie", command.get());
if (NS_SUCCEEDED(rv) && TestFlag(IMAP_CONNECTION_IS_OPEN) && m_outputStream)
{
IncrementCommandTagNumber();
command = GetServerCommandTag();
command.Append(" logout" CRLF);
rv = m_outputStream->Write(command.get(), command.Length(),
&writeCount);
Log("SendData", "TellThreadToDie", command.get());
}
}
if (mAsyncReadRequest)