aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/smtp
diff options
context:
space:
mode:
Diffstat (limited to 'src/async/smtp')
-rw-r--r--src/async/smtp/MCSMTPAsyncSession.cc12
-rw-r--r--src/async/smtp/MCSMTPAsyncSession.h5
-rw-r--r--src/async/smtp/MCSMTPOperation.cc10
3 files changed, 27 insertions, 0 deletions
diff --git a/src/async/smtp/MCSMTPAsyncSession.cc b/src/async/smtp/MCSMTPAsyncSession.cc
index e24efc09..1964c944 100644
--- a/src/async/smtp/MCSMTPAsyncSession.cc
+++ b/src/async/smtp/MCSMTPAsyncSession.cc
@@ -272,3 +272,15 @@ void SMTPAsyncSession::logConnection(ConnectionLogType logType, Data * buffer)
}
pthread_mutex_unlock(&mConnectionLoggerLock);
}
+
+#if __APPLE__
+void SMTPAsyncSession::setDispatchQueue(dispatch_queue_t dispatchQueue)
+{
+ mQueue->setDispatchQueue(dispatchQueue);
+}
+
+dispatch_queue_t SMTPAsyncSession::dispatchQueue()
+{
+ return mQueue->dispatchQueue();
+}
+#endif
diff --git a/src/async/smtp/MCSMTPAsyncSession.h b/src/async/smtp/MCSMTPAsyncSession.h
index 63630b77..b3ef4455 100644
--- a/src/async/smtp/MCSMTPAsyncSession.h
+++ b/src/async/smtp/MCSMTPAsyncSession.h
@@ -54,6 +54,11 @@ namespace mailcore {
virtual void setConnectionLogger(ConnectionLogger * logger);
virtual ConnectionLogger * connectionLogger();
+#ifdef __APPLE__
+ virtual void setDispatchQueue(dispatch_queue_t dispatchQueue);
+ virtual dispatch_queue_t dispatchQueue();
+#endif
+
virtual SMTPOperation * sendMessageOperation(Data * messageData);
virtual SMTPOperation * sendMessageOperation(Address * from, Array * recipients,
Data * messageData);
diff --git a/src/async/smtp/MCSMTPOperation.cc b/src/async/smtp/MCSMTPOperation.cc
index 0b180c5f..9ddcede2 100644
--- a/src/async/smtp/MCSMTPOperation.cc
+++ b/src/async/smtp/MCSMTPOperation.cc
@@ -29,6 +29,16 @@ SMTPOperation::~SMTPOperation()
void SMTPOperation::setSession(SMTPAsyncSession * session)
{
MC_SAFE_REPLACE_RETAIN(SMTPAsyncSession, mSession, session);
+#if __APPLE__
+ dispatch_queue_t queue;
+ if (session != NULL) {
+ queue = session->dispatchQueue();
+ }
+ else {
+ queue = dispatch_get_main_queue();
+ }
+ setCallbackDispatchQueue(queue);
+#endif
}
SMTPAsyncSession * SMTPOperation::session()