зеркало из https://github.com/mozilla/gecko-dev.git
make protocol use imapMailFolder header parse stuff when getting headers
This commit is contained in:
Родитель
d01ece3796
Коммит
cdbcefa255
|
@ -1601,7 +1601,13 @@ void nsImapProtocol::BeginMessageDownLoad(
|
|||
si->content_type = PL_strdup(content_type);
|
||||
if (si->content_type)
|
||||
{
|
||||
if (m_imapMessage)
|
||||
|
||||
if (GetServerStateParser().GetDownloadingHeaders())
|
||||
{
|
||||
if (m_imapMailFolder)
|
||||
m_imapMailFolder->SetupHeaderParseStream(this, si);
|
||||
}
|
||||
else if (m_imapMessage)
|
||||
{
|
||||
m_imapMessage->SetupMsgWriteStream(this, si);
|
||||
WaitForFEEventCompletion();
|
||||
|
@ -2175,7 +2181,13 @@ nsImapProtocol::PostLineDownLoadEvent(msg_line_info *downloadLineDontDelete)
|
|||
{
|
||||
NS_ASSERTION(downloadLineDontDelete,
|
||||
"Oops... null msg line info not good");
|
||||
if (m_imapMessage && downloadLineDontDelete)
|
||||
|
||||
if (GetServerStateParser().GetDownloadingHeaders())
|
||||
{
|
||||
if (m_imapMailFolder && downloadLineDontDelete)
|
||||
m_imapMailFolder->ParseAdoptedHeaderLine(this, downloadLineDontDelete);
|
||||
}
|
||||
else if (m_imapMessage && downloadLineDontDelete)
|
||||
m_imapMessage->ParseAdoptedMsgLine(this, downloadLineDontDelete);
|
||||
|
||||
// ***** We need to handle the psuedo interrupt here *****
|
||||
|
@ -2310,7 +2322,12 @@ void nsImapProtocol::NormalMessageEndDownload()
|
|||
m_downloadLineCache.ResetCache();
|
||||
}
|
||||
|
||||
if (m_imapMessage)
|
||||
if (GetServerStateParser().GetDownloadingHeaders())
|
||||
{
|
||||
if (m_imapMailFolder)
|
||||
m_imapMailFolder->NormalEndHeaderParseStream(this);
|
||||
}
|
||||
else if (m_imapMessage)
|
||||
m_imapMessage->NormalEndMsgWriteStream(this);
|
||||
|
||||
}
|
||||
|
@ -2328,7 +2345,12 @@ void nsImapProtocol::AbortMessageDownLoad()
|
|||
m_downloadLineCache.ResetCache();
|
||||
}
|
||||
|
||||
if (m_imapMessage)
|
||||
if (GetServerStateParser().GetDownloadingHeaders())
|
||||
{
|
||||
if (m_imapMailFolder)
|
||||
m_imapMailFolder->AbortHeaderParseStream(this);
|
||||
}
|
||||
else if (m_imapMessage)
|
||||
m_imapMessage->AbortMsgWriteStream(this);
|
||||
|
||||
}
|
||||
|
|
|
@ -2034,6 +2034,11 @@ PRBool nsImapServerResponseParser::GetFillingInShell()
|
|||
return (m_shell != nsnull);
|
||||
}
|
||||
|
||||
PRBool nsImapServerResponseParser::GetDownloadingHeaders()
|
||||
{
|
||||
return fDownloadingHeaders;
|
||||
}
|
||||
|
||||
// Tells the server state parser to use a previously cached shell.
|
||||
void nsImapServerResponseParser::UseCachedShell(nsIMAPBodyShell *cachedShell)
|
||||
{
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
virtual PRUint16 SettablePermanentFlags() { return fSettablePermanentFlags;};
|
||||
void SetFlagState(nsImapFlagAndUidState *state);
|
||||
|
||||
PRBool GetDownloadingHeaders();
|
||||
PRBool GetFillingInShell();
|
||||
void UseCachedShell(nsIMAPBodyShell *cachedShell);
|
||||
void SetHostSessionList(nsIImapHostSessionList *aHostSession);
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
#include "nsMsgDatabase.h"
|
||||
|
||||
#include "nsImapFlagAndUidState.h"
|
||||
#include "nsParseMailbox.h"
|
||||
|
||||
#ifdef XP_PC
|
||||
#define NETLIB_DLL "netlib.dll"
|
||||
|
@ -267,6 +268,7 @@ protected:
|
|||
|
||||
nsIImapUrl * m_url;
|
||||
nsIImapProtocol * m_IMAP4Protocol; // running protocol instance
|
||||
nsParseMailMessageState *m_msgParser ;
|
||||
|
||||
PRBool m_runTestHarness;
|
||||
PRBool m_runningURL; // are we currently running a url? this flag is set to false when the url finishes...
|
||||
|
@ -622,7 +624,7 @@ void nsIMAP4TestDriver::PrepareToAddHeadersToMailDB(nsIImapProtocol* aProtocol,
|
|||
aProtocol->NotifyHdrsToDownload(theKeys, total /*keysToFetch.GetSize() */);
|
||||
// now, tell it we don't need any bodies.
|
||||
if (aProtocol)
|
||||
aProtocol->NotifyHdrsToDownload(NULL, 0);
|
||||
aProtocol->NotifyBodysToDownload(NULL, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -700,13 +702,21 @@ NS_IMETHODIMP nsIMAP4TestDriver::SetupHeaderParseStream(nsIImapProtocol* aProtoc
|
|||
StreamInfo* aStreamInfo)
|
||||
{
|
||||
printf("**** nsIMAP4TestDriver::SetupHeaderParseStream\r\n");
|
||||
return NS_OK;
|
||||
m_msgParser = new nsParseMailMessageState;
|
||||
if (m_msgParser)
|
||||
{
|
||||
m_msgParser->m_state = MBOX_PARSE_HEADERS;
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsIMAP4TestDriver::ParseAdoptedHeaderLine(nsIImapProtocol* aProtocol,
|
||||
msg_line_info* aMsgLineInfo)
|
||||
{
|
||||
printf("**** nsIMAP4TestDriver::ParseAdoptedHeaderLine\r\n");
|
||||
m_msgParser->ParseFolderLine(aMsgLineInfo->adoptedMessageLine, PL_strlen(aMsgLineInfo->adoptedMessageLine));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ LLIBS= $(LLIBS) ole32.lib \
|
|||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\raptorbase.lib \
|
||||
$(DIST)\lib\msgcoreutil.lib \
|
||||
$(DIST)\lib\msglocal.lib \
|
||||
$(DIST)\lib\xpcom32.lib
|
||||
|
||||
|
||||
|
@ -82,6 +83,7 @@ LINCS=$(LINCS) -I. \
|
|||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\rdfutil \
|
||||
-I$(PUBLIC)\rdf \
|
||||
-I$(PUBLIC)\mime \
|
||||
-I$(PUBLIC)\xpcom
|
||||
|
||||
# clobber and clobber_all will remove the following garbage:
|
||||
|
|
Загрузка…
Ссылка в новой задаче