evolution-data-server r9544 - trunk/camel/providers/imap



Author: pchen
Date: Sun Sep 14 07:14:28 2008
New Revision: 9544
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9544&view=rev

Log:
Fixes a infinite loop while expunging the folders.

Modified:
   trunk/camel/providers/imap/ChangeLog
   trunk/camel/providers/imap/camel-imap-folder.c
   trunk/camel/providers/imap/camel-imap-journal.h

Modified: trunk/camel/providers/imap/camel-imap-folder.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-folder.c	(original)
+++ trunk/camel/providers/imap/camel-imap-folder.c	Sun Sep 14 07:14:28 2008
@@ -278,6 +278,7 @@
 	}
 
 	imap_folder->search = camel_imap_search_new(folder_dir);
+	
 	camel_offline_journal_replay (imap_folder->journal, ex);
 	camel_imap_journal_close_folders ((CamelIMAPJournal *)imap_folder->journal);
 	camel_offline_journal_write (CAMEL_IMAP_FOLDER (folder)->journal, ex);
@@ -1282,6 +1283,7 @@
 {
 	CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
 	CamelImapMessageInfo *info;
+	CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
 	CamelException local_ex;
 
 	GPtrArray *matches, *summary;
@@ -1414,9 +1416,16 @@
 	if (expunge)
 		imap_expunge (folder, ex);
 
-	camel_offline_journal_replay (CAMEL_IMAP_FOLDER (folder)->journal, ex);
-	camel_imap_journal_close_folders ((CamelIMAPJournal *) CAMEL_IMAP_FOLDER (folder)->journal);
-	camel_offline_journal_write (CAMEL_IMAP_FOLDER (folder)->journal, ex);
+	/* Check if the replay is already in progress as imap_sync would be called while expunge resync */
+	if (!CAMEL_IMAP_JOURNAL (imap_folder->journal)->rp_in_progress) {
+		CAMEL_IMAP_JOURNAL (imap_folder->journal)->rp_in_progress = TRUE;
+	
+		camel_offline_journal_replay (imap_folder->journal, ex);
+		camel_imap_journal_close_folders ((CamelIMAPJournal *)imap_folder->journal);
+		camel_offline_journal_write (CAMEL_IMAP_FOLDER (folder)->journal, ex);
+
+		CAMEL_IMAP_JOURNAL (imap_folder->journal)->rp_in_progress = FALSE;
+	}
 
 	g_ptr_array_foreach (summary, (GFunc) camel_pstring_free, NULL);
 	g_ptr_array_free (summary, TRUE);

Modified: trunk/camel/providers/imap/camel-imap-journal.h
==============================================================================
--- trunk/camel/providers/imap/camel-imap-journal.h	(original)
+++ trunk/camel/providers/imap/camel-imap-journal.h	Sun Sep 14 07:14:28 2008
@@ -70,6 +70,7 @@
 
 	GHashTable *folders;
 	GHashTable *uidmap;	
+	gboolean rp_in_progress;
 };
 
 struct _CamelIMAPJournalClass {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]