Backed out changeset 7a29a83fb1ab (bug 1494764) for attachment corruption when chunking. a=jorgk DONTBUILD
authorJorg K <jorgk@jorgk.com>
Mon, 11 Feb 2019 17:22:10 +0100
changeset 33483 5ce15c6f7f46
parent 33482 bb057edd9bbb
child 33484 229ecb18ba73
push id2376
push usermozilla@jorgk.com
push dateMon, 11 Feb 2019 16:26:19 +0000
treeherdercomm-beta@5ce15c6f7f46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1494764
backs out7a29a83fb1ab
Backed out changeset 7a29a83fb1ab (bug 1494764) for attachment corruption when chunking. a=jorgk DONTBUILD
mailnews/imap/src/nsImapServerResponseParser.cpp
--- a/mailnews/imap/src/nsImapServerResponseParser.cpp
+++ b/mailnews/imap/src/nsImapServerResponseParser.cpp
@@ -3169,23 +3169,21 @@ bool nsImapServerResponseParser::msg_fet
       // who cares about binary transparency, and anyway \0 in this context violates RFCs.
       charsReadSoFar += strlen(fCurrentLine);
       if (!fDownloadingHeaders && fCurrentCommandIsSingleMessageFetch)
       {
         fServerConnection.ProgressEventFunctionUsingName("imapDownloadingMessage");
         if (fTotalDownloadSize > 0)
           fServerConnection.PercentProgressUpdateEvent(0, charsReadSoFar + origin, fTotalDownloadSize);
       }
-      if (!lastChunk && (charsReadSoFar > numberOfCharsInThisChunk))
+      if (charsReadSoFar > numberOfCharsInThisChunk)
       {
-        // This is the last line of a chunk but not the last chunk of a multi-chunk
-        // message or the only "chunk" of a smaller non-chunked message. "Literal" here
-        // means actual email data and its EOLs, without imap protocol elements and their
-        // EOLs. End of line is defined by two characters \r\n (i.e., CRLF, 0xd,0xa)
-        // specified by RFC822.
+        // This is the last line of a chunk. "Literal" here means actual email data and
+        // its EOLs, without imap protocol elements and their EOLs. End of line is
+        // defined by two characters \r\n (i.e., CRLF, 0xd,0xa) specified by RFC822.
         // Here is an example the most typical last good line of a chunk:
         // "1s8AA5i4AAvF4QAG6+sAAD0bAPsAAAAA1OAAC)\r\n", where ")\r\n" are non-literals.
         // This an example of the last "good" line of a chunk that terminates with \r\n
         // "FxcA/wAAAALN2gADu80ACS0nAPpVVAD1wNAABF5YAPhAJgD31+QABAAAAP8oMQD+HBwA/umj\r\n"
         // followed by another line of non-literal data:
         // " UID 1004)\r\n". These two are concatenated into a single string pointed to
         // by fCurrentLine.  The extra "non-literal data" on the last chunk line makes
         // the charsReadSoFar greater than numberOfCharsInThisChunk (the configured
@@ -3245,17 +3243,17 @@ bool nsImapServerResponseParser::msg_fet
         fServerConnection.HandleMessageDownLoadLine(fCurrentLine, !lastChunk);
         // Restore fCurrentLine's original content.
         displayEndOfLine[1] = saveit1;
         if (fNextChunkStartsWithNewline)
           displayEndOfLine[2] = saveit2;
       }
       else
       {
-        // Not the last line of a chunk or any line when lastChunk.
+        // Not the last line of a chunk.
         if (!fNextChunkStartsWithNewline)
         {
           // Process unmodified fCurrentLine string.
           fServerConnection.HandleMessageDownLoadLine(fCurrentLine,
             !lastChunk && (charsReadSoFar == numberOfCharsInThisChunk),
             fCurrentLine);
         }
         else