Revision: 7283
          http://svn.sourceforge.net/mahogany/?rev=7283&view=rev
Author:   vadz
Date:     2007-06-06 15:42:28 -0700 (Wed, 06 Jun 2007)

Log Message:
-----------
try to fix a potential crash in MailFolderCC::GetHeaderInfo() if the connection 
was broken while the element was being overviewed

Modified Paths:
--------------
    trunk/M/src/mail/MailFolderCC.cpp

Modified: trunk/M/src/mail/MailFolderCC.cpp
===================================================================
--- trunk/M/src/mail/MailFolderCC.cpp   2007-06-06 00:28:47 UTC (rev 7282)
+++ trunk/M/src/mail/MailFolderCC.cpp   2007-06-06 22:42:28 UTC (rev 7283)
@@ -4363,33 +4363,25 @@
 
    // do fill the listing
    size_t n;
-   for ( UIdType i = seq.GetFirst(n); i != UID_ILLEGAL; i = seq.GetNext(i, n) )
+   for ( UIdType i = seq.GetFirst(n);
+         i != UID_ILLEGAL && m_MailStream;
+         i = seq.GetNext(i, n) )
    {
       MESSAGECACHE *elt = mail_elt(m_MailStream, i);
       if ( !elt )
       {
-         if ( !m_MailStream )
-         {
-            // the stream is dead, abort
-            break;
-         }
+         // it's ok if we failed because we lost connection but otherwise this
+         // is unexpected
+         ASSERT_MSG( !m_MailStream, "failed to get sequence element?" );
 
-         FAIL_MSG( _T("failed to get sequence element?") );
-
          continue;
       }
 
       ENVELOPE *env = mail_fetch_structure(m_MailStream, i, NIL, NIL);
       if ( !env )
       {
-         if ( !m_MailStream )
-         {
-            // connection was broken, don't try to get the others
-            break;
-         }
+         ASSERT_MSG( !m_MailStream, "failed to get sequence element envelope?" 
);
 
-         FAIL_MSG( _T("failed to get sequence element envelope?") );
-
          continue;
       }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to