diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2015-04-01 23:35:46 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2015-04-02 23:50:04 -0700 |
commit | cbee27cd693ceed2738d88a39e71d7a599b9e28f (patch) | |
tree | 2e498b2fe2f60532fc866bc5f96ce4ef65c47c88 /src | |
parent | 0d010747d431b612eac5959d9db832dcfdaf46b1 (diff) |
disconnection operation, disconnect when pipeline is enabled
Diffstat (limited to 'src')
-rw-r--r-- | src/async/smtp/MCSMTPAsyncSession.cpp | 7 | ||||
-rw-r--r-- | src/async/smtp/MCSMTPAsyncSession.h | 2 | ||||
-rw-r--r-- | src/core/smtp/MCSMTPSession.cpp | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/async/smtp/MCSMTPAsyncSession.cpp b/src/async/smtp/MCSMTPAsyncSession.cpp index 9fe55e2e..d2f645da 100644 --- a/src/async/smtp/MCSMTPAsyncSession.cpp +++ b/src/async/smtp/MCSMTPAsyncSession.cpp @@ -255,6 +255,13 @@ SMTPOperation * SMTPAsyncSession::noopOperation() return (SMTPOperation *) op->autorelease(); } +SMTPOperation * SMTPAsyncSession::disconnectOperation() +{ + SMTPDisconnectOperation * op = new SMTPDisconnectOperation(); + op->setSession(this); + return (SMTPOperation *) op->autorelease(); +} + void SMTPAsyncSession::setConnectionLogger(ConnectionLogger * logger) { pthread_mutex_lock(&mConnectionLoggerLock); diff --git a/src/async/smtp/MCSMTPAsyncSession.h b/src/async/smtp/MCSMTPAsyncSession.h index 38da3717..90849797 100644 --- a/src/async/smtp/MCSMTPAsyncSession.h +++ b/src/async/smtp/MCSMTPAsyncSession.h @@ -72,6 +72,8 @@ namespace mailcore { virtual SMTPOperation * noopOperation(); + virtual SMTPOperation * disconnectOperation(); + public: // private virtual void runOperation(SMTPOperation * operation); virtual SMTPSession * session(); diff --git a/src/core/smtp/MCSMTPSession.cpp b/src/core/smtp/MCSMTPSession.cpp index eab05730..cb9b02cb 100644 --- a/src/core/smtp/MCSMTPSession.cpp +++ b/src/core/smtp/MCSMTPSession.cpp @@ -626,6 +626,7 @@ void SMTPSession::sendMessage(Address * from, Array * recipients, Data * message r = mailesmtp_send_quit(mSmtp, MCUTF8(from->mailbox()), 0, NULL, address_list, messageData->bytes(), messageData->length()); + mShouldDisconnect = true; } else { r = mailesmtp_send(mSmtp, MCUTF8(from->mailbox()), 0, NULL, |