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),
|
fMessage(firstMessage),
|
||||||
fEndMessage(lastMessage),
|
fEndMessage(lastMessage),
|
||||||
fOutData(NULL),
|
fOutData(NULL),
|
||||||
fFetchBodyLimit(fetchBodyLimit),
|
fFetchBodyLimit(fetchBodyLimit)
|
||||||
fHandled(false)
|
|
||||||
{
|
{
|
||||||
|
if (fEndMessage > 0)
|
||||||
|
fUnhandled = fEndMessage - fMessage + 1;
|
||||||
|
else
|
||||||
|
fUnhandled = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FetchMessageCommand::~FetchMessageCommand()
|
FetchMessageCommand::~FetchMessageCommand()
|
||||||
{
|
{
|
||||||
if (!fHandled)
|
for (int32 i = 0; i < fUnhandled; i++)
|
||||||
fIMAPMailbox.Listener().FetchEnd();
|
fIMAPMailbox.Listener().FetchEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,7 +411,7 @@ FetchMessageCommand::Handle(const BString& response)
|
|||||||
BString lastLine;
|
BString lastLine;
|
||||||
fConnectionReader.GetNextLine(lastLine);
|
fConnectionReader.GetNextLine(lastLine);
|
||||||
|
|
||||||
fHandled = true;
|
fUnhandled--;
|
||||||
|
|
||||||
bool bodyIsComing = true;
|
bool bodyIsComing = true;
|
||||||
if (fFetchBodyLimit >= 0 && fFetchBodyLimit <= messageSize)
|
if (fFetchBodyLimit >= 0 && fFetchBodyLimit <= messageSize)
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ private:
|
|||||||
int32 fEndMessage;
|
int32 fEndMessage;
|
||||||
BPositionIO* fOutData;
|
BPositionIO* fOutData;
|
||||||
int32 fFetchBodyLimit;
|
int32 fFetchBodyLimit;
|
||||||
bool fHandled;
|
int32 fUnhandled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user