2007-03-20 [colin] 2.8.1cvs23
authorColin Leroy <colin@colino.net>
Tue, 20 Mar 2007 17:25:59 +0000 (17:25 +0000)
committerColin Leroy <colin@colino.net>
Tue, 20 Mar 2007 17:25:59 +0000 (17:25 +0000)
* src/imap.c
* src/remotefolder.h
Fix bug 1153, 'CM segfaults if IMAP folder is
selected while scanning prior to update'

ChangeLog
PATCHSETS
configure.ac
src/imap.c
src/remotefolder.h

index 5874c37dad8cb6512e212ef05b50636976f3aa9d..4ad10ab7da395a6112ac1fa1b21bff3f471ae04b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-20 [colin]     2.8.1cvs23
+
+       * src/imap.c
+       * src/remotefolder.h
+               Fix bug 1153, 'CM segfaults if IMAP folder is 
+               selected while scanning prior to update'
+
 2007-03-17 [paul]      2.8.1cvs22
 
        * src/main.c
index 2cc117738e85691d030c5da3579ce83078b838a9..b5616c303002cbdec77dc9bcd20ec05f85257043 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.25.2.18 -r 1.25.2.19 tools/Makefile.am;  cvs diff -u -r 1.30.2.18 -r 1.30.2.19 tools/README;  ) > 2.8.1cvs20.patchset
 ( cvs diff -u -r 1.149.2.66 -r 1.149.2.67 src/inc.c;  ) > 2.8.1cvs21.patchset
 ( cvs diff -u -r 1.115.2.142 -r 1.115.2.143 src/main.c;  ) > 2.8.1cvs22.patchset
+( cvs diff -u -r 1.179.2.158 -r 1.179.2.159 src/imap.c;  cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/remotefolder.h;  ) > 2.8.1cvs23.patchset
index d74eb755b58a7f1487f0b7cb28d61a4ef9bb9cc3..f38092a209a21815bbaabbacd279191dfc88f089 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=22
+EXTRA_VERSION=23
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4a7a25b242727e25ec491f738174a17273f364b4..faf71ffb43be9be14a3c1d51e14f185c478af06c 100644 (file)
@@ -723,14 +723,19 @@ static IMAPSession *imap_session_get(Folder *folder)
        /* Make sure we have a session */
        if (rfolder->session != NULL) {
                session = IMAP_SESSION(rfolder->session);
+       } else if (rfolder->connecting) {
+               debug_print("already connecting\n");
+               return NULL;
        } else {
                imap_reset_uid_lists(folder);
                if (time(NULL) - rfolder->last_failure <= 2)
                        return NULL;
+               rfolder->connecting = TRUE;
                session = imap_session_new(folder, folder->account);
        }
        if(session == NULL) {
                rfolder->last_failure = time(NULL);
+               rfolder->connecting = FALSE;
                return NULL;
        }
 
@@ -744,6 +749,7 @@ static IMAPSession *imap_session_get(Folder *folder)
                session_destroy(SESSION(session));
                rfolder->session = NULL;
                rfolder->last_failure = time(NULL);
+               rfolder->connecting = FALSE;
                return NULL;
        }
 
@@ -766,6 +772,7 @@ static IMAPSession *imap_session_get(Folder *folder)
        }
 
        rfolder->session = SESSION(session);
+       rfolder->connecting = FALSE;
 
        return IMAP_SESSION(session);
 }
index 748fb8235fc10d97946ec7aad36df0adb0f97388..c032966b33accbb641451596221d99e989411336 100644 (file)
@@ -35,6 +35,7 @@ struct _RemoteFolder
 
        Session *session;
        time_t last_failure;
+       gboolean connecting;
 };
 
 void        folder_remote_folder_init  (Folder         *folder,