From 053d2b4ee0712a3de57c2dd1228c28a23d0a0c02 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 5 Dec 2012 21:02:34 +0100 Subject: [PATCH] Fixed progression notification when message size is lower than 64K. --- src/net/pop3/POP3Store.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp index f8a8ec0a..749c5dea 100644 --- a/src/net/pop3/POP3Store.cpp +++ b/src/net/pop3/POP3Store.cpp @@ -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); - } } }