summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Sanders <don.sanders@nokia.com>2011-06-22 05:18:06 +1000
committerDon Sanders <don.sanders@nokia.com>2011-06-22 05:18:06 +1000
commit18c817bbab6c47f13c6e5ebe65e5185d6e05f1e0 (patch)
treecf0d55d17a14b10be3e249dcd3231f9acc3eafb7
parent4a659f06eac69b48a3f299d152bd055c7ee5e67a (diff)
Don't send spurious LOGOUT when closing connection.
Fixes NB#265236 "Error occurred" shown frequently when syncing emails
-rw-r--r--CHANGES1
-rw-r--r--src/plugins/messageservices/imap/imapclient.cpp14
2 files changed, 9 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index b3f95413..d0bf907b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ Latest Changes
* Fixes: NB#232541 Invitations not displayed in the message viewer for Gmail
* Fixes: NB#265381 crash in QMailHeartbeatTimer::stop()
* Fixes: NB#267768 messageserver segfaults @ QtMobility::QSystemAlignedTimerPrivate::error
+ * Fixes: NB#265236 "Error occurred" shown frequently when syncing emails
201123
* Fixes: NB#265223 Original message body shown empty in message view
diff --git a/src/plugins/messageservices/imap/imapclient.cpp b/src/plugins/messageservices/imap/imapclient.cpp
index 70cd0b9b..205bcc4f 100644
--- a/src/plugins/messageservices/imap/imapclient.cpp
+++ b/src/plugins/messageservices/imap/imapclient.cpp
@@ -1305,11 +1305,7 @@ void ImapClient::transportError(QMailServiceAction::Status::ErrorCode code, cons
void ImapClient::closeConnection()
{
_inactiveTimer.stop();
-
- if ( _protocol.connected() ) {
- emit updateStatus( tr("Logging out") );
- _protocol.sendLogout();
- } else if ( _protocol.inUse() ) {
+ if ( _protocol.inUse() ) {
_protocol.close();
}
}
@@ -1349,7 +1345,13 @@ void ImapClient::connectionInactive()
Q_ASSERT(_closeCount >= 0);
if (_closeCount == 0) {
_rapidClosing = false;
- closeConnection();
+ if ( _protocol.connected()) {
+ emit updateStatus( tr("Logging out") );
+ _protocol.sendLogout();
+ // Client MUST read tagged response, but if connection hangs in logout state newConnection will autoClose.
+ } else {
+ closeConnection();
+ }
} else {
--_closeCount;
_protocol.sendNoop();