[evolution-patches] 313574, crash in imap



not sure if this patch fixes the bug but it does fix a logic bug.

Index: camel/providers/imap/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/ChangeLog,v
retrieving revision 1.28
diff -u -p -r1.28 ChangeLog
--- camel/providers/imap/ChangeLog	17 Aug 2005 04:58:51 -0000	1.28
+++ camel/providers/imap/ChangeLog	17 Aug 2005 06:44:59 -0000
@@ -1,3 +1,10 @@
+2005-08-17  Not Zed  <NotZed Ximian com>
+
+	** See bug #313574.
+
+	* camel-imap-folder.c (imap_get_message): added required lock
+	around imap connect/command & clear exception for fail-over.
+
 2005-08-16  Not Zed  <NotZed Ximian com>
 
 	** See bug #242032.
Index: camel/providers/imap/camel-imap-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/camel-imap-folder.c,v
retrieving revision 1.350
diff -u -p -r1.350 camel-imap-folder.c
--- camel/providers/imap/camel-imap-folder.c	17 Aug 2005 04:58:51 -0000	1.350
+++ camel/providers/imap/camel-imap-folder.c	17 Aug 2005 06:44:59 -0000
@@ -2086,13 +2086,17 @@ imap_get_message (CamelFolder *folder, c
 				char *body, *found_uid;
 				int i;
 				
+				CAMEL_SERVICE_LOCK(store, connect_lock);
 				if (!camel_imap_store_connected(store, ex)) {
+					CAMEL_SERVICE_UNLOCK(store, connect_lock);
 					camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
 							     _("This message is not currently available"));
 					goto fail;
 				}
 				
 				response = camel_imap_command (store, folder, ex, "UID FETCH %s BODY", uid);
+				CAMEL_SERVICE_UNLOCK(store, connect_lock);
+
 				if (response) {
 					for (i = 0, body = NULL; i < response->untagged->len; i++) {
 						fetch_data = parse_fetch_response (imap_folder, response->untagged->pdata[i]);
@@ -2108,6 +2112,7 @@ imap_get_message (CamelFolder *folder, c
 					}
 					
 					if (body) {
+						/* NB: small race here, setting the info.content */
 						imap_parse_body ((const char **) &body, folder, mi->info.content);
 						camel_folder_summary_touch (folder->summary);
 					}
@@ -2116,6 +2121,8 @@ imap_get_message (CamelFolder *folder, c
 						g_datalist_clear (&fetch_data);
 					
 					camel_imap_response_free (store, response);
+				} else {
+					camel_exception_clear(ex);
 				}
 			}
 


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