2006-06-02 [colin] 2.2.0cvs74
authorColin Leroy <colin@colino.net>
Fri, 2 Jun 2006 16:48:40 +0000 (16:48 +0000)
committerColin Leroy <colin@colino.net>
Fri, 2 Jun 2006 16:48:40 +0000 (16:48 +0000)
* src/main.c
On exit, free caches after writing them
Shuts up some valgrind false positives
* src/procmsg.c
* src/send_message.c
Fix races when reusing existing SMTP connections
Fix inexistant session timeout
* src/toolbar.c
Display alertpanel after all queues have
been processed, not after each

ChangeLog
PATCHSETS
configure.ac
src/inc.c
src/main.c
src/procmsg.c
src/send_message.c
src/toolbar.c

index ba62420d5a0049c97c05bbd9248cbe9f7aa140c4..d4216dcc6ab84e5fad2f645ec03a72ab40dd31ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-06-02 [colin]     2.2.0cvs74
+
+       * src/main.c
+               On exit, free caches after writing them
+               Shuts up some valgrind false positives
+       * src/procmsg.c
+       * src/send_message.c
+               Fix races when reusing existing SMTP connections
+               Fix inexistant session timeout
+       * src/toolbar.c
+               Display alertpanel after all queues have
+               been processed, not after each
+
 2006-06-02 [wwp]       2.2.0cvs73
 
        * manual/fr/glossary.xml
index fed7ae6170a1c7561d38cb73a673dfd172ef2121..816fe97d10f1333a5a1b6a4218738c203b3dfa8e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.274 -r 1.382.2.275 src/compose.c;  cvs diff -u -r 1.115.2.87 -r 1.115.2.88 src/main.c;  cvs diff -u -r 1.204.2.86 -r 1.204.2.87 src/prefs_common.c;  cvs diff -u -r 1.103.2.49 -r 1.103.2.50 src/prefs_common.h;  cvs diff -u -r 1.4.2.9 -r 1.4.2.10 src/common/ssl_certificate.c;  cvs diff -u -r 1.1.4.38 -r 1.1.4.39 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/etpan/imap-thread.h;  cvs diff -u -r 1.9.2.11 -r 1.9.2.12 src/gtk/sslcertwindow.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 manual/advanced.xml;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 manual/fr/advanced.xml;  ) > 2.2.0cvs71.patchset
 ( diff -u /dev/null manual/xml2pdf;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/dist/pdf/Makefile.am;  diff -u /dev/null manual/dtd/manual.xsl;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/fr/dist/pdf/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/pl/dist/pdf/Makefile.am;  ) > 2.2.0cvs72.patchset
 ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 manual/fr/glossary.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/fr/ack.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/ack.xml;  ) > 2.2.0cvs73.patchset
+( cvs diff -u -r 1.115.2.88 -r 1.115.2.89 src/main.c;  cvs diff -u -r 1.150.2.65 -r 1.150.2.66 src/procmsg.c;  cvs diff -u -r 1.17.2.29 -r 1.17.2.30 src/send_message.c;  cvs diff -u -r 1.43.2.45 -r 1.43.2.46 src/toolbar.c;  ) > 2.2.0cvs74.patchset
index f5cf0797c8583a195e5a5789b3b8bc9ea75a2b03..d4b79a9149c1fbe0d936758c11079e1fa74f6248 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=2
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=73
+EXTRA_VERSION=74
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index d7a4e51bb67d6cb1c36a6f8fa5dc77603881bd91..4ea415db65c4c29a286547e33a967da189b7531e 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -50,6 +50,7 @@
 #include "utils.h"
 #include "gtkutils.h"
 #include "statusbar.h"
+#include "msgcache.h"
 #include "manage_window.h"
 #include "stock_pixmap.h"
 #include "progressdialog.h"
index 47d86df9e1e7d231c9b10fdf3bb97d288ffcf059..41cbc4948b2b7978552fcc1bf8f0dc8785ee9d36 100644 (file)
@@ -604,7 +604,11 @@ static void save_all_caches(FolderItem *item, gpointer data)
        if (!item->cache) {
                return;
        }
-       folder_item_write_cache(item);
+
+       if (item->opened)
+               folder_item_close(item);
+
+       folder_item_free_cache(item);
 }
 
 static void exit_sylpheed(MainWindow *mainwin)
index f74fb78cab277c5db52171408119d4a6e65bc25e..5f9ec777b1441d5ded1fe6b2838e031ca7de26c6 100644 (file)
@@ -44,6 +44,7 @@
 #include "partial_download.h"
 #include "mainwindow.h"
 #include "summaryview.h"
+#include "log.h"
 #include "timing.h"
 
 static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session);
@@ -878,7 +879,13 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
        GSList *list, *elem;
        GSList *sorted_list = NULL;
        GNode *node, *next;
-
+       static gboolean send_queue_lock = FALSE;
+       
+       if (send_queue_lock) {
+               log_error(_("Already trying to send\n"));
+               return -1;
+       }
+       send_queue_lock = TRUE;
        if (!queue)
                queue = folder_get_default_queue();
        g_return_val_if_fail(queue != NULL, -1);
@@ -903,16 +910,6 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                                                  msginfo->msgnum);
                                        err++;
                                } else {
-                                       /* CLAWS: 
-                                        * We save in procmsg_send_message_queue because
-                                        * we need the destination folder from the queue
-                                        * header
-                                                       
-                                       if (save_msgs)
-                                               procmsg_save_to_outbox
-                                                       (queue->folder->outbox,
-                                                        file, TRUE);
-                                        */
                                        sent++; 
                                        folder_item_remove_msg(queue, msginfo->msgnum);
                                }
@@ -941,7 +938,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                        node = next;
                }
        }
-
+       send_queue_lock = FALSE;
        return (err != 0 ? -err : sent);
 }
 
index faa7ef56665a8d3ed6867f50f672c3ff0049de6b..8d220b9cbc8525b60a5787bcc6b5dcde9bfc4757 100644 (file)
@@ -321,12 +321,12 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                        (session, send_send_data_progressive, dialog);
                session_set_send_data_notify(session, send_send_data_finished, dialog);
 
-               ac_prefs->session = SMTP_SESSION(session);
        } else {
                /* everything is ready to start at MAIL FROM:, just
                 * reinit useful variables. 
                 */
                session = SESSION(ac_prefs->session);
+               ac_prefs->session = NULL;
                smtp_session = SMTP_SESSION(session);
                smtp_session->state = SMTP_HELO;
                dialog = (SendProgressDialog *)smtp_session->dialog;
@@ -340,6 +340,8 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
        smtp_session->send_data = get_outgoing_rfc2822_str(fp);
        smtp_session->send_data_len = strlen(smtp_session->send_data);
 
+       session_set_timeout(session,
+                           prefs_common.io_timeout_secs * 1000);
        /* connect if necessary */
        if (!was_inited && session_connect(session, ac_prefs->smtp_server, port) < 0) {
                session_destroy(session);
@@ -408,6 +410,9 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                g_free(smtp_session->send_data);
                g_free(smtp_session->error_msg);
        }
+       if (keep_session && ret == 0 && ac_prefs->session == NULL)
+               ac_prefs->session = SMTP_SESSION(session);
+
 
        statusbar_pop_all();
        statusbar_verbosity_set(FALSE);
index b4ab79dc51d89ee8cbab0648a9538ad1a25c9517..e45391eeee4265ee9482f82cc86ac866353af334 100644 (file)
@@ -2084,6 +2084,7 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
 {
        GList *list;
        gboolean found;
+       gboolean got_error = FALSE;
 
        if (prefs_common.work_offline)
                if (alertpanel(_("Offline warning"), 
@@ -2120,10 +2121,12 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
                if (folder->queue) {
                        if (procmsg_send_queue(folder->queue, 
                                               prefs_common.savemsg) < 0)
-                               alertpanel_error(_("Some errors occurred while "
-                                                  "sending queued messages."));
+                               got_error = TRUE;
                }
        }
+       if (got_error)
+               alertpanel_error(_("Some errors occurred while "
+                                  "sending queued messages."));
 }
 
 void compose_mail_cb(gpointer data, guint action, GtkWidget *widget)