fix 95601 crash after getting new pop mail before selecting pop inbox r=naving, sr=sspitzer

This commit is contained in:
bienvenu%netscape.com 2001-08-22 03:53:31 +00:00
Родитель 6ad6ce43c3
Коммит 29c35bc365
4 изменённых файлов: 21 добавлений и 18 удалений

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

@ -2124,6 +2124,9 @@ nsMsgDBView::GetLocationCollationKey(nsIMsgHdr *msgHdr, PRUint8 **result, PRUint
rv = msgHdr->GetFolder(getter_AddRefs(folder));
NS_ENSURE_SUCCESS(rv,rv);
if (!folder)
return NS_ERROR_NULL_POINTER;
nsCOMPtr <nsIMsgDatabase> dbToUse;
rv = folder->GetMsgDatabase(nsnull, getter_AddRefs(dbToUse));
NS_ENSURE_SUCCESS(rv,rv);

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

@ -520,12 +520,12 @@ NS_IMETHODIMP nsParseMailMessageState::SetEnvelopePos(PRUint32 aEnvelopePos)
NS_IMETHODIMP nsParseMailMessageState::GetNewMsgHdr(nsIMsgDBHdr ** aMsgHeader)
{
if (aMsgHeader)
{
*aMsgHeader = m_newMsgHdr;
NS_IF_ADDREF(*aMsgHeader);
}
return NS_OK;
if (aMsgHeader)
{
*aMsgHeader = m_newMsgHdr;
NS_IF_ADDREF(*aMsgHeader);
}
return NS_OK;
}
NS_IMETHODIMP nsParseMailMessageState::ParseAFolderLine(const char *line, PRUint32 lineLength)
@ -679,14 +679,14 @@ nsParseMailMessageState::IsEnvelopeLine(const char *buf, PRInt32 buf_size)
// We've found the start of the next message, so finish this one off.
NS_IMETHODIMP nsParseMailMessageState::FinishHeader()
{
if (m_newMsgHdr)
{
m_newMsgHdr->SetMessageKey(m_envelope_pos);
m_newMsgHdr->SetMessageSize(m_position - m_envelope_pos); // dmb - no longer number of lines.
m_newMsgHdr->SetLineCount(m_body_lines);
}
return NS_OK;
if (m_newMsgHdr)
{
m_newMsgHdr->SetMessageKey(m_envelope_pos);
m_newMsgHdr->SetMessageSize(m_position - m_envelope_pos); // dmb - no longer number of lines.
m_newMsgHdr->SetLineCount(m_body_lines);
}
return NS_OK;
}
NS_IMETHODIMP nsParseMailMessageState::GetAllHeaders(char ** pHeaders, PRInt32 *pHeadersSize)
@ -1342,7 +1342,7 @@ nsParseNewMailState::nsParseNewMailState()
NS_IMPL_ISUPPORTS_INHERITED(nsParseNewMailState, nsMsgMailboxParser, nsIMsgFilterHitNotify)
nsresult
nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStream *inboxFileStream)
nsParseNewMailState::Init(nsIFolder *rootFolder, nsIMsgFolder *downloadFolder, nsFileSpec &folder, nsIOFileStream *inboxFileStream)
{
nsresult rv;
m_position = folder.GetFileSize();
@ -1357,7 +1357,7 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStr
{
nsCOMPtr <nsIFileSpec> dbFileSpec;
NS_NewFileSpecWithSpec(folder, getter_AddRefs(dbFileSpec));
rv = mailDB->Open(dbFileSpec, PR_TRUE, PR_FALSE, (nsIMsgDatabase **) getter_AddRefs(m_mailDB));
rv = mailDB->OpenFolderDB(downloadFolder, PR_TRUE, PR_FALSE, (nsIMsgDatabase **) getter_AddRefs(m_mailDB));
}
// rv = nsMailDatabase::Open(folder, PR_TRUE, &m_mailDB, PR_FALSE);
if (NS_FAILED(rv))

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

@ -217,7 +217,7 @@ public:
nsParseNewMailState();
virtual ~nsParseNewMailState();
NS_DECL_ISUPPORTS_INHERITED
nsresult Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStream *inboxFileStream);
nsresult Init(nsIFolder *rootFolder, nsIMsgFolder *downloadFolder, nsFileSpec &folder, nsIOFileStream *inboxFileStream);
virtual void DoneParsingFolder(nsresult status);
virtual void SetUsingTempDB(PRBool usingTempDB, char *tmpDBName);

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

@ -186,7 +186,7 @@ nsPop3Sink::BeginMailDelivery(PRBool uidlDownload, PRBool* aBool)
rv = GetServerFolder(getter_AddRefs(serverFolder));
if (NS_FAILED(rv)) return rv;
rv = m_newMailParser->Init(serverFolder, fileSpec, m_outFileStream);
rv = m_newMailParser->Init(serverFolder, m_folder, fileSpec, m_outFileStream);
// if we failed to initialize the parser, then just don't use it!!!
// we can still continue without one...
if (NS_FAILED(rv))