Author: czeidler Date: 2011-03-09 23:22:36 +0100 (Wed, 09 Mar 2011) New Revision: 40892 Changeset: http://dev.haiku-os.org/changeset/40892 Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h Log: There could more then one message fetch failing, count them to notify the listener. Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp 2011-03-09 22:18:27 UTC (rev 40891) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp 2011-03-09 22:22:36 UTC (rev 40892) @@ -318,16 +318,18 @@ fMessage(firstMessage), fEndMessage(lastMessage), fOutData(NULL), - fFetchBodyLimit(fetchBodyLimit), - fHandled(false) + fFetchBodyLimit(fetchBodyLimit) { - + if (fEndMessage > 0) + fUnhandled = fEndMessage - fMessage + 1; + else + fUnhandled = 1; } FetchMessageCommand::~FetchMessageCommand() { - if (!fHandled) + for (int32 i = 0; i < fUnhandled; i++) fIMAPMailbox.Listener().FetchEnd(); } @@ -409,7 +411,7 @@ BString lastLine; fConnectionReader.GetNextLine(lastLine); - fHandled = true; + fUnhandled--; bool bodyIsComing = true; if (fFetchBodyLimit >= 0 && fFetchBodyLimit <= messageSize) Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h 2011-03-09 22:18:27 UTC (rev 40891) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.h 2011-03-09 22:22:36 UTC (rev 40892) @@ -140,7 +140,7 @@ int32 fEndMessage; BPositionIO* fOutData; int32 fFetchBodyLimit; - bool fHandled; + int32 fUnhandled; };