From 2ee9be3ad5b68bcb759789141d51f8978163b260 Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Tue, 4 Dec 2001 00:18:12 +0000 Subject: [PATCH] fix assertion about 0 msg size when first msg you select is fetched with mpod r=cavin, sr=mscott --- .../imap/src/nsImapServerResponseParser.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mailnews/imap/src/nsImapServerResponseParser.cpp b/mailnews/imap/src/nsImapServerResponseParser.cpp index af1d406dc2a4..118522d6d65d 100644 --- a/mailnews/imap/src/nsImapServerResponseParser.cpp +++ b/mailnews/imap/src/nsImapServerResponseParser.cpp @@ -2688,14 +2688,15 @@ void nsImapServerResponseParser::SetSyntaxError(PRBool error) nsresult nsImapServerResponseParser::BeginMessageDownload(const char *content_type) { - NS_ASSERTION(fSizeOfMostRecentMessage > 0, "most recent message has 0 or negative size"); - nsresult rv = fServerConnection.BeginMessageDownLoad(fSizeOfMostRecentMessage, - content_type); - if (NS_FAILED(rv)) - { - skip_to_CRLF(); - fServerConnection.PseudoInterrupt(PR_TRUE); - fServerConnection.AbortMessageDownLoad(); - } + // if we're downloading a message, assert that we know its size. + NS_ASSERTION(fDownloadingHeaders || fSizeOfMostRecentMessage > 0, "most recent message has 0 or negative size"); + nsresult rv = fServerConnection.BeginMessageDownLoad(fSizeOfMostRecentMessage, + content_type); + if (NS_FAILED(rv)) + { + skip_to_CRLF(); + fServerConnection.PseudoInterrupt(PR_TRUE); + fServerConnection.AbortMessageDownLoad(); + } return rv; }