mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Fix for bug 128888. Do not emit a MIME header for a message/rfc822 part. Also fix bogus partNum string extraction. R=bienvenu, SR=mscott, A=asa
This commit is contained in:
parent
2863ac5493
commit
8b21a292e9
@ -289,8 +289,7 @@ PRInt32 nsIMAPBodyShell::Generate(char *partNum)
|
||||
if (!GetPseudoInterrupted() && !DeathSignalReceived())
|
||||
{
|
||||
nsresult rv =
|
||||
m_protocolConnection->BeginMessageDownLoad(contentLength,
|
||||
MESSAGE_RFC822);
|
||||
m_protocolConnection->BeginMessageDownLoad(contentLength, MESSAGE_RFC822);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
m_generatingPart = nsnull;
|
||||
@ -1040,6 +1039,8 @@ PRInt32 nsIMAPBodypartMessage::Generate(PRBool stream, PRBool prefetch)
|
||||
|
||||
if (!m_topLevelMessage && !m_shell->GetPseudoInterrupted()) // not the top-level message - we need the MIME header as well as the message header
|
||||
{
|
||||
// but we don't need the MIME header of a message/rfc822 part!
|
||||
if (PL_strcasecmp(m_bodyType, "message") || PL_strcasecmp(m_bodySubType, "rfc822"))
|
||||
m_contentLength += GenerateMIMEHeader(stream, prefetch);
|
||||
}
|
||||
|
||||
|
@ -1090,10 +1090,11 @@ void nsImapServerResponseParser::msg_fetch()
|
||||
char *startPartNum = fNextToken + 5;
|
||||
if (whereHeader > startPartNum)
|
||||
{
|
||||
char *partNum = (char *)PR_CALLOC((whereHeader - startPartNum) * sizeof (char));
|
||||
PRInt32 partLength = whereHeader - startPartNum - 1; //-1 for the dot!
|
||||
char *partNum = (char *)PR_CALLOC((partLength + 1) * sizeof (char));
|
||||
if (partNum)
|
||||
{
|
||||
PL_strncpy(partNum, startPartNum, (whereHeader - startPartNum));
|
||||
PL_strncpy(partNum, startPartNum, partLength);
|
||||
if (ContinueParse())
|
||||
{
|
||||
if (PL_strstr(fNextToken, "FIELDS"))
|
||||
|
Loading…
Reference in New Issue
Block a user