aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-mt.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-21 12:19:30 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-21 12:19:30 +0800
commit50ef085e18b3cd54f1cea88ceb20156a56fb050d (patch)
tree7c58ef7f050d802dccf2a583fc225a5de40a997b /mail/mail-mt.c
parente511bc95beadc682485d432312f50d9ae1be7566 (diff)
downloadgsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.tar
gsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.tar.gz
gsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.tar.bz2
gsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.tar.lz
gsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.tar.xz
gsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.tar.zst
gsoc2013-evolution-50ef085e18b3cd54f1cea88ceb20156a56fb050d.zip
Init a cancel field in the message. (mail_msg_free): Free it.
2001-01-21 Not Zed <NotZed@Ximian.com> * mail-mt.c (mail_msg_new): Init a cancel field in the message. (mail_msg_free): Free it. (mail_msg_cancel): New function to attempt to cancel an operation by id. Impelementation functions can still be uncancellable by not registering for cancellation, etc, or do it themselves as well. * mail-send-recv.c (fetch_mail_filter_folder): set folder_uid's properly, so we can save it later. (filter_folder_filter): Renamed from fetch_mail_filter_folder, since its going to be used for all filtering. (mail_fetch_mail): Changed from mail_filter_mail. (mail_filter_folder): New function, replaces mail_do_filter_ondemand functionality. (mail_filter_on_demand): New function, actually replaces mail_do_filter_ondemand. (receive_get_folder): Added an exception arg. (mail_send_message): New function to just send a message. (send_mail_send): Use mail_send_message. (send_queue_send): New send qeue code, use mail_send_message, and clean up some stuff. (mail_send_receive): Changed from mail_receive. (build_dialogue): Setup the sending data, as well. (mail_update_subfolders): New function to update folder info. (send_mail_send): hook into cancellation if we want. svn path=/trunk/; revision=7672
Diffstat (limited to 'mail/mail-mt.c')
-rw-r--r--mail/mail-mt.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index b18f78c06e..1735432070 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -40,6 +40,7 @@ void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size)
msg->ops = ops;
msg->seq = mail_msg_seq++;
msg->msg.reply_port = reply_port;
+ msg->cancel = camel_cancel_new();
camel_exception_init(&msg->ex);
g_hash_table_insert(mail_msg_active, (void *)msg->seq, msg);
@@ -63,6 +64,7 @@ void mail_msg_free(void *msg)
MAIL_MT_UNLOCK(mail_msg_lock);
+ camel_cancel_unref(m->cancel);
camel_exception_clear(&m->ex);
g_free(m);
}
@@ -91,6 +93,20 @@ void mail_msg_check_error(void *msg)
g_free(text);
}
+void mail_msg_cancel(unsigned int msgid)
+{
+ struct _mail_msg *m;
+
+ MAIL_MT_LOCK(mail_msg_lock);
+ m = g_hash_table_lookup(mail_msg_active, (void *)msgid);
+
+ if (m)
+ camel_cancel_cancel(m->cancel);
+
+ MAIL_MT_UNLOCK(mail_msg_lock);
+}
+
+
/* waits for a message to be finished processing (freed)
the messageid is from struct _mail_msg->seq */
void mail_msg_wait(unsigned int msgid)