+2011-10-25 [colin] 3.7.10cvs50
+
+ * src/compose.c
+ * src/messageview.c
+ * src/procmsg.c
+ * src/procmsg.h
+ Fix locking when sending a single message
+
2011-10-25 [colin] 3.7.10cvs49
* src/gtk/colorlabel.c
( cvs diff -u -r 1.83.2.174 -r 1.83.2.175 src/mimeview.c; ) > 3.7.10cvs47.patchset
( cvs diff -u -r 1.25.2.70 -r 1.25.2.71 src/stock_pixmap.c; ) > 3.7.10cvs48.patchset
( cvs diff -u -r 1.2.2.35 -r 1.2.2.36 src/gtk/colorlabel.c; cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/gtk/gtkcmclist.c; ) > 3.7.10cvs49.patchset
+( cvs diff -u -r 1.382.2.587 -r 1.382.2.588 src/compose.c; cvs diff -u -r 1.94.2.220 -r 1.94.2.221 src/messageview.c; cvs diff -u -r 1.150.2.118 -r 1.150.2.119 src/procmsg.c; cvs diff -u -r 1.60.2.56 -r 1.60.2.57 src/procmsg.h; ) > 3.7.10cvs50.patchset
MICRO_VERSION=10
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=49
+EXTRA_VERSION=50
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
}
if (msgpath == NULL) {
msgpath = folder_item_fetch_msg(folder, msgnum);
- val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum, &queued_removed);
+ val = procmsg_send_message_queue_with_lock(msgpath, &errstr, folder, msgnum, &queued_removed);
g_free(msgpath);
} else {
- val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum, &queued_removed);
+ val = procmsg_send_message_queue_with_lock(msgpath, &errstr, folder, msgnum, &queued_removed);
claws_unlink(msgpath);
g_free(msgpath);
}
/* send it */
path = folder_item_fetch_msg(queue, num);
- ok = procmsg_send_message_queue(path, &foo, queue, num, &queued_removed);
+ ok = procmsg_send_message_queue_with_lock(path, &foo, queue, num, &queued_removed);
g_free(path);
g_free(foo);
if (ok == 0 && !queued_removed)
}
static gboolean send_queue_lock = FALSE;
+
+gboolean procmsg_queue_lock(char **errstr)
+{
+ if (send_queue_lock) {
+ /* Avoid having to translate two similar strings */
+ log_warning(LOG_PROTOCOL, "%s\n", _("Already trying to send."));
+ if (errstr) {
+ if (*errstr) g_free(*errstr);
+ *errstr = g_strdup_printf(_("Already trying to send."));
+ }
+ return FALSE;
+ }
+ send_queue_lock = TRUE;
+ return TRUE;
+}
+void procmsg_queue_unlock(void)
+{
+ send_queue_lock = FALSE;
+}
/*!
*\brief Send messages in queue
*
GSList *sorted_list = NULL;
GNode *node, *next;
- if (send_queue_lock) {
- /* Avoid having to translate two similar strings */
- log_warning(LOG_PROTOCOL, "%s\n", _("Already trying to send."));
- if (errstr) {
- if (*errstr) g_free(*errstr);
- *errstr = g_strdup_printf(_("Already trying to send."));
- }
+ if (!procmsg_queue_lock(errstr)) {
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
return -1;
}
- send_queue_lock = TRUE;
inc_lock();
if (!queue)
queue = folder_get_default_queue();
if (queue == NULL) {
- send_queue_lock = FALSE;
+ procmsg_queue_unlock();
inc_unlock();
return -1;
}
node = next;
}
}
- send_queue_lock = FALSE;
+ procmsg_queue_unlock();
inc_unlock();
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
return result;
}
+gint procmsg_send_message_queue_with_lock(const gchar *file, gchar **errstr, FolderItem *queue, gint msgnum, gboolean *queued_removed)
+{
+ gint val;
+ if (procmsg_queue_lock(errstr)) {
+ val = procmsg_send_message_queue(file, errstr, queue, msgnum, queued_removed);
+ procmsg_queue_unlock();
+ return val;
+ }
+ return -1;
+}
+
static void update_folder_msg_counts(FolderItem *item, MsgInfo *msginfo, MsgPermFlags old_flags)
{
MsgPermFlags new_flags = msginfo->flags.perm_flags;
gint procmsg_send_queue (FolderItem *queue,
gboolean save_msgs,
gchar **errstr);
+gboolean procmsg_queue_lock (gchar **errstr);
+void procmsg_queue_unlock (void);
gboolean procmsg_queue_is_empty (FolderItem *queue);
void procmsg_print_message (MsgInfo *msginfo,
const gchar *cmdline);
void procmsg_msginfo_free (MsgInfo *msginfo);
guint procmsg_msginfo_memusage (MsgInfo *msginfo);
+gint procmsg_send_message_queue_with_lock(const gchar *file,
+ gchar **errstr,
+ FolderItem *queue,
+ gint msgnum,
+ gboolean *queued_removed);
+
gint procmsg_send_message_queue (const gchar *file,
gchar **errstr,
FolderItem *queue,