evolution-data-server r9195 - in trunk/camel: . providers/imap



Author: sragavan
Date: Sat Jul 26 11:15:46 2008
New Revision: 9195
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9195&view=rev

Log:
2008-07-26  Srinivasa Ragavan  <sragavan novell com>

	** Fix for bug #544825

	* camel/camel-folder-summary.c:
	* camel/providers/imap/camel-imap-folder.c: Never hold the summary
	lock and do a disk operation. It leads to dead lock.


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

Modified: trunk/camel/camel-folder-summary.c
==============================================================================
--- trunk/camel/camel-folder-summary.c	(original)
+++ trunk/camel/camel-folder-summary.c	Sat Jul 26 11:15:46 2008
@@ -2028,6 +2028,7 @@
 	} else {
 		/* Info isn't loaded into the memory. We must just remove the UID*/
 		g_ptr_array_remove_index(s->uids, index);
+		camel_pstring_free (uid);
 		CAMEL_SUMMARY_UNLOCK(s, ref_lock);
 		CAMEL_SUMMARY_UNLOCK(s, summary_lock);
 

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	Sat Jul 26 11:15:46 2008
@@ -3220,6 +3220,7 @@
 	changes = camel_folder_change_info_new ();
 	if (expunged) {
 		int i, id;
+		GList *deleted = NULL;
 		
 		for (i = 0; i < expunged->len; i++) {
 			id = g_array_index (expunged, int, i);
@@ -3229,14 +3230,19 @@
 				/* I guess a message that we never retrieved got expunged? */
 				continue;
 			}
-			
+
+			deleted = g_list_prepend(deleted, uid);
 			camel_folder_change_info_remove_uid (changes, uid);
 			CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock);
 			camel_imap_message_cache_remove (imap_folder->cache, uid);
 			CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock);
-			camel_folder_summary_remove_uid (folder->summary, uid);
-			g_free (uid);
+			camel_folder_summary_remove_index_fast (CamelFolderSummary *s, id-1)
 		}
+		
+		/* Delete all in one transaction */
+		camel_db_delete_uids (folder->cdb, folder->full_name, deleted, ex);
+		g_list_foreach (deleted, g_free);
+		g_list_free (deleted);
 	}
 
 	len = camel_folder_summary_count (folder->summary);



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