зеркало из https://github.com/mozilla/gecko-dev.git
fix another cause of 83396 alert from cyrus imap server about message containing bare newlines, sr=mscott
This commit is contained in:
Родитель
298931f15a
Коммит
3357b06204
|
@ -2916,6 +2916,12 @@ NS_IMETHODIMP nsImapMailFolder::CopyData(nsIInputStream *aIStream,
|
|||
m_copyState->m_dataBuffer[m_copyState->m_leftOver] = '\0';
|
||||
|
||||
start = m_copyState->m_dataBuffer;
|
||||
if (m_copyState->m_eatLF)
|
||||
{
|
||||
if (*start == nsCRT::LF)
|
||||
start++;
|
||||
m_copyState->m_eatLF = PR_FALSE;
|
||||
}
|
||||
end = PL_strchr(start, '\r');
|
||||
if (!end)
|
||||
end = PL_strchr(start, '\n');
|
||||
|
@ -2947,6 +2953,8 @@ NS_IMETHODIMP nsImapMailFolder::CopyData(nsIInputStream *aIStream,
|
|||
end = PL_strchr(start, '\n');
|
||||
else if (*(end+1) == nsCRT::LF)
|
||||
linebreak_len = 2;
|
||||
else if (! *(end+1)) // block might have split CRLF so remember if
|
||||
m_copyState->m_eatLF = PR_TRUE; // we should eat LF
|
||||
|
||||
if (start && !end)
|
||||
{
|
||||
|
@ -6675,7 +6683,8 @@ nsImapMailCopyState::nsImapMailCopyState() :
|
|||
m_isMove(PR_FALSE), m_selectedState(PR_FALSE),
|
||||
m_isCrossServerOp(PR_FALSE), m_curIndex(0),
|
||||
m_totalCount(0), m_streamCopy(PR_FALSE), m_dataBuffer(nsnull),
|
||||
m_dataBufferSize(0), m_leftOver(0), m_allowUndo(PR_FALSE)
|
||||
m_dataBufferSize(0), m_leftOver(0), m_allowUndo(PR_FALSE),
|
||||
m_eatLF(PR_FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ public:
|
|||
PRUint32 m_dataBufferSize;
|
||||
PRUint32 m_leftOver;
|
||||
PRBool m_allowUndo;
|
||||
PRBool m_eatLF;
|
||||
};
|
||||
|
||||
// ACLs for this folder.
|
||||
|
|
Загрузка…
Ссылка в новой задаче