aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/smtp
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-06-22 22:28:41 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-06-22 22:29:05 -0700
commit9682845dd6a6985f396a93ff95adc1dcdeae8861 (patch)
tree67e053e5e87b5c228191440116c1b839dbf2aecc /src/async/smtp
parent74752eb7c987a2c1704f6f92486e4a4d3f77cbfb (diff)
Retain session when IMAP and SMTP operations are running. Fixed #127, fixed #128.
Diffstat (limited to 'src/async/smtp')
-rw-r--r--src/async/smtp/MCSMTPAsyncSession.cc8
-rw-r--r--src/async/smtp/MCSMTPSendWithDataOperation.cc2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/async/smtp/MCSMTPAsyncSession.cc b/src/async/smtp/MCSMTPAsyncSession.cc
index cf028ced..73bc2a54 100644
--- a/src/async/smtp/MCSMTPAsyncSession.cc
+++ b/src/async/smtp/MCSMTPAsyncSession.cc
@@ -19,8 +19,13 @@ namespace mailcore {
virtual ~SMTPOperationQueueCallback() {
}
- virtual void queueIdle() {
+ virtual void queueStartRunning() {
+ mSession->retain();
+ }
+
+ virtual void queueStoppedRunning() {
mSession->tryAutomaticDisconnect();
+ mSession->release();
}
private:
@@ -38,6 +43,7 @@ SMTPAsyncSession::SMTPAsyncSession()
SMTPAsyncSession::~SMTPAsyncSession()
{
+ cancelDelayedPerformMethod((Object::Method) &SMTPAsyncSession::tryAutomaticDisconnectAfterDelay, NULL);
MC_SAFE_RELEASE(mQueueCallback);
MC_SAFE_RELEASE(mQueue);
MC_SAFE_RELEASE(mSession);
diff --git a/src/async/smtp/MCSMTPSendWithDataOperation.cc b/src/async/smtp/MCSMTPSendWithDataOperation.cc
index b64f835b..bb2c5ea9 100644
--- a/src/async/smtp/MCSMTPSendWithDataOperation.cc
+++ b/src/async/smtp/MCSMTPSendWithDataOperation.cc
@@ -38,6 +38,4 @@ void SMTPSendWithDataOperation::main()
ErrorCode error;
session()->session()->sendMessage(mMessageData, this, &error);
setError(error);
-
- //tryAutomaticDisconnect();
}