Fixed progression notification when message size is lower than 64K.

This commit is contained in:
Vincent Richard 2012-12-05 21:02:34 +01:00
parent 052cf47fcc
commit 053d2b4ee0

View File

@ -893,10 +893,19 @@ void POP3Store::readResponse(utility::outputStream& os,
if (m_timeoutHandler)
m_timeoutHandler->resetTimeOut();
// Notify progress
current += read;
if (progress)
{
total = std::max(total, current);
progress->progress(current, total);
}
// If we don't have extracted the response code yet
if (!codeDone)
{
temp += string(buffer, read);
temp.append(buffer, read);
string firstLine;
@ -917,14 +926,6 @@ void POP3Store::readResponse(utility::outputStream& os,
{
// Inject the data into the output stream
os.write(buffer, read);
current += read;
// Notify progress
if (progress)
{
total = std::max(total, current);
progress->progress(current, total);
}
}
}