There could more then one message fetch failing, count them to notify the listener.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40892 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -318,16 +318,18 @@ FetchMessageCommand::FetchMessageCommand(IMAPMailbox& mailbox,
|
||||
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 @@ FetchMessageCommand::Handle(const BString& response)
|
||||
BString lastLine;
|
||||
fConnectionReader.GetNextLine(lastLine);
|
||||
|
||||
fHandled = true;
|
||||
fUnhandled--;
|
||||
|
||||
bool bodyIsComing = true;
|
||||
if (fFetchBodyLimit >= 0 && fFetchBodyLimit <= messageSize)
|
||||
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
int32 fEndMessage;
|
||||
BPositionIO* fOutData;
|
||||
int32 fFetchBodyLimit;
|
||||
bool fHandled;
|
||||
int32 fUnhandled;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user