Skip to content

Commit cbee27c

Browse files
committed
disconnection operation, disconnect when pipeline is enabled
1 parent 0d01074 commit cbee27c

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/async/smtp/MCSMTPAsyncSession.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ SMTPOperation * SMTPAsyncSession::noopOperation()
255255
return (SMTPOperation *) op->autorelease();
256256
}
257257

258+
SMTPOperation * SMTPAsyncSession::disconnectOperation()
259+
{
260+
SMTPDisconnectOperation * op = new SMTPDisconnectOperation();
261+
op->setSession(this);
262+
return (SMTPOperation *) op->autorelease();
263+
}
264+
258265
void SMTPAsyncSession::setConnectionLogger(ConnectionLogger * logger)
259266
{
260267
pthread_mutex_lock(&mConnectionLoggerLock);

src/async/smtp/MCSMTPAsyncSession.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ namespace mailcore {
7272

7373
virtual SMTPOperation * noopOperation();
7474

75+
virtual SMTPOperation * disconnectOperation();
76+
7577
public: // private
7678
virtual void runOperation(SMTPOperation * operation);
7779
virtual SMTPSession * session();

src/core/smtp/MCSMTPSession.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ void SMTPSession::sendMessage(Address * from, Array * recipients, Data * message
626626
r = mailesmtp_send_quit(mSmtp, MCUTF8(from->mailbox()), 0, NULL,
627627
address_list,
628628
messageData->bytes(), messageData->length());
629+
mShouldDisconnect = true;
629630
}
630631
else {
631632
r = mailesmtp_send(mSmtp, MCUTF8(from->mailbox()), 0, NULL,

0 commit comments

Comments
 (0)