2010-02-20 [colin] 3.7.5cvs22
authorColin Leroy <colin@colino.net>
Sat, 20 Feb 2010 18:16:45 +0000 (18:16 +0000)
committerColin Leroy <colin@colino.net>
Sat, 20 Feb 2010 18:16:45 +0000 (18:16 +0000)
* src/imap.c
* src/imap.h
* src/main.c
* src/mainwindow.c
* src/etpan/imap-thread.c
* src/etpan/imap-thread.h
* src/etpan/nntp-thread.c
* src/etpan/nntp-thread.h
When going offline from NetworkManager, just
delete IMAP connections. That'll avoid timeouts
when coming back online in certain cases when
the TCP socket will have timed out.

ChangeLog
PATCHSETS
configure.ac
src/etpan/imap-thread.c
src/etpan/imap-thread.h
src/etpan/nntp-thread.c
src/etpan/nntp-thread.h
src/imap.c
src/imap.h
src/main.c
src/mainwindow.c

index 176629c962cb1129543a521de1c939f9f0ccbd7e..7eaab246d9b8cb924de77345ce3ab69b0bd12b83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-20 [colin]     3.7.5cvs22
+
+       * src/imap.c
+       * src/imap.h
+       * src/main.c
+       * src/mainwindow.c
+       * src/etpan/imap-thread.c
+       * src/etpan/imap-thread.h
+       * src/etpan/nntp-thread.c
+       * src/etpan/nntp-thread.h
+               When going offline from NetworkManager, just
+               delete IMAP connections. That'll avoid timeouts
+               when coming back online in certain cases when
+               the TCP socket will have timed out.
+
 2010-02-20 [holger]    3.7.5cvs21
 
        * .cvsignore
index 23d2c8f904176d941972da1da347d14e717f5662..1d2c7d83b214286042c647a16c38614922d00fd1 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.417 -r 1.395.2.418 src/summaryview.c;  cvs diff -u -r 1.68.2.53 -r 1.68.2.54 src/summaryview.h;  cvs diff -u -r 1.43.2.113 -r 1.43.2.114 src/toolbar.c;  ) > 3.7.5cvs19.patchset
 ( cvs diff -u -r 1.395.2.418 -r 1.395.2.419 src/summaryview.c;  cvs diff -u -r 1.68.2.54 -r 1.68.2.55 src/summaryview.h;  cvs diff -u -r 1.43.2.114 -r 1.43.2.115 src/toolbar.c;  ) > 3.7.5cvs20.patchset
 ( cvs diff -u -r 1.8.2.7 -r 1.8.2.8 .cvsignore;  ) > 3.7.5cvs21.patchset
+( cvs diff -u -r 1.179.2.249 -r 1.179.2.250 src/imap.c;  cvs diff -u -r 1.34.2.21 -r 1.34.2.22 src/imap.h;  cvs diff -u -r 1.115.2.224 -r 1.115.2.225 src/main.c;  cvs diff -u -r 1.274.2.306 -r 1.274.2.307 src/mainwindow.c;  cvs diff -u -r 1.1.4.110 -r 1.1.4.111 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.26 -r 1.1.4.27 src/etpan/imap-thread.h;  cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/etpan/nntp-thread.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/etpan/nntp-thread.h;  ) > 3.7.5cvs22.patchset
index 3df7c647ca3fb0f00be596b68e0dbcacebee900a..82be81f95c8c8556728632868920031b09b6312a 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=21
+EXTRA_VERSION=22
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index ab212521638b53f3c427a249d6e1c886a1f55835..8cb700d0ab44e2c17b9e0b6efb9de47293dd8099 100644 (file)
@@ -296,9 +296,9 @@ void imap_main_set_timeout(int sec)
        mailstream_network_delay.tv_usec = 0;
 }
 
-void imap_main_done(void)
+void imap_main_done(gboolean have_connectivity)
 {
-       imap_disconnect_all();
+       imap_disconnect_all(have_connectivity);
        etpan_thread_manager_stop(thread_manager);
 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
        return;
@@ -3398,7 +3398,7 @@ void imap_threaded_cancel(Folder * folder)
 void imap_main_init(void)
 {
 }
-void imap_main_done(void)
+void imap_main_done(gboolean have_connectivity)
 {
 }
 void imap_main_set_timeout(int sec)
index 868bfe2820125fa961c66a568fc72bea0c838ab5..37eaf349d6c0798c3697d61466edd9f94598fe5b 100644 (file)
@@ -40,7 +40,7 @@ typedef enum
 
 void imap_main_set_timeout(int sec);
 void imap_main_init(gboolean skip_ssl_cert_check);
-void imap_main_done(void);
+void imap_main_done(gboolean have_connectivity);
 
 void imap_init(Folder * folder);
 void imap_done(Folder * folder);
index eb6e393e8bd5965231087d9eb1e3a90e607df421..47a59a38944e8c01d8d23907a4bb25b640c7092c 100644 (file)
@@ -156,7 +156,7 @@ void nntp_main_init(gboolean skip_ssl_cert_check)
                                                    NULL);
 }
 
-void nntp_main_done(void)
+void nntp_main_done(gboolean have_connectivity)
 {
        etpan_thread_manager_stop(thread_manager);
 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
@@ -1005,7 +1005,7 @@ int nntp_threaded_xhdr(Folder * folder, const char *header, guint32 beg, guint32
 void nntp_main_init(void)
 {
 }
-void nntp_main_done(void)
+void nntp_main_done(gboolean have_connectivity)
 {
 }
 void nntp_main_set_timeout(int sec)
index cab2eca032243be8861bf40e0991ce0e956f0ce7..0a09ddca6d44a6df822aa7e4c037a58ed4dbbee8 100644 (file)
@@ -26,7 +26,7 @@
 
 void nntp_main_set_timeout(int sec);
 void nntp_main_init(gboolean skip_ssl_cert_check);
-void nntp_main_done(void);
+void nntp_main_done(gboolean have_connectivity);
 
 void nntp_init(Folder * folder);
 void nntp_done(Folder * folder);
index 828133de353c6c87d6b2a77b4a358a9b49aa78b7..4498f5de380783b470e21d1e76b782d50e6e3bc0 100644 (file)
@@ -5398,7 +5398,7 @@ void imap_folder_ref(Folder *folder)
        ((IMAPFolder *)folder)->refcnt++;
 }
 
-void imap_disconnect_all(void)
+void imap_disconnect_all(gboolean have_connectivity)
 {
        GList *list;
        gboolean short_timeout;
@@ -5426,7 +5426,8 @@ void imap_disconnect_all(void)
                        RemoteFolder *folder = (RemoteFolder *)account->folder;
                        if (folder && folder->session) {
                                IMAPSession *session = (IMAPSession *)folder->session;
-                               imap_threaded_disconnect(FOLDER(folder));
+                               if (have_connectivity)
+                                       imap_threaded_disconnect(FOLDER(folder));
                                SESSION(session)->state = SESSION_DISCONNECTED;
                                SESSION(session)->sock = NULL;
                                session_destroy(SESSION(session));
@@ -5571,7 +5572,7 @@ FolderClass *imap_get_class(void)
        return &imap_class;
 }
 
-void imap_disconnect_all(void)
+void imap_disconnect_all(gboolean have_connectivity)
 {
 }
 
index 2dc9a12df75086de6593ff1325a6dba8eea85605..80ccbdf8d9971c11733949498a9bf3047471d869 100644 (file)
@@ -36,7 +36,7 @@ guint imap_folder_get_refcnt(Folder *folder);
 void imap_folder_ref(Folder *folder);
 void imap_folder_unref(Folder *folder);
 gchar imap_get_path_separator_for_item (FolderItem *item);
-void imap_disconnect_all(void);
+void imap_disconnect_all(gboolean have_connectivity);
 gint imap_subscribe(Folder *folder, FolderItem *item, gchar *rpath, gboolean sub);
 GList *imap_scan_subtree(Folder *folder, FolderItem *item, gboolean unsubs_only, gboolean recursive);
 void imap_cache_msg(FolderItem *item, gint msgnum);
index 3398f2514fe5793ce188a17a2d1669fbfca4e075..854caa94b3873d531f59ace1246d6ebfb3eae2a1 100644 (file)
@@ -1696,6 +1696,7 @@ static void save_all_caches(FolderItem *item, gpointer data)
 static void exit_claws(MainWindow *mainwin)
 {
        gchar *filename;
+       gboolean have_connectivity;
 
        sc_exiting = TRUE;
 
@@ -1738,9 +1739,14 @@ static void exit_claws(MainWindow *mainwin)
        close_log_file(LOG_PROTOCOL);
        close_log_file(LOG_DEBUG_FILTERING);
 
+#ifdef HAVE_NETWORKMANAGER_SUPPORT
+       have_connectivity = networkmanager_is_online(NULL); 
+#else
+       have_connectivity = TRUE;
+#endif
 #ifdef HAVE_LIBETPAN
-       imap_main_done();
-       nntp_main_done();
+       imap_main_done(have_connectivity);
+       nntp_main_done(have_connectivity);
 #endif
        /* delete crashfile */
        if (!cmd.crash)
index 7da44308e764b3ab7e5f5bb421c41d151bec9c1f..919ea8df7792e18443ea486f6062cf634c1440f6 100644 (file)
@@ -4230,8 +4230,7 @@ static void online_switch_clicked (GtkButton *btn, gpointer data)
                if(have_connectivity)
                        mainwindow_check_synchronise(mainwin, TRUE);
                prefs_common.work_offline = TRUE;
-               if(have_connectivity)
-                       imap_disconnect_all();
+               imap_disconnect_all(have_connectivity);
                hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
        } else {
                /*go online */