[evolution-patches] 53876, camel imap race
- From: Not Zed <notzed ximian com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] 53876, camel imap race
- Date: Tue, 24 Feb 2004 21:59:59 +0800
This patch is for head but applies to 1.4, and should probably be
applied. It can lead to crashes.
http://bugzilla.ximian.com/show_bug.cgi?id=53876
Although we need to verify the fix in 1.5 first.
Michael
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2018
diff -u -3 -r1.2018 ChangeLog
--- camel/ChangeLog 23 Feb 2004 20:58:17 -0000 1.2018
+++ camel/ChangeLog 24 Feb 2004 14:01:53 -0000
@@ -1,3 +1,15 @@
+2004-02-24 Not Zed <NotZed Ximian com>
+
+ ** See bug #53876.
+
+ * providers/imap/camel-imap-command.c (camel_imap_command): ref
+ the folder before unreffing store->current_folder, incase they're
+ the same. Do a select anyway.
+
+ * providers/imap/camel-imap-folder.c (imap_refresh_info): keep the
+ connect_lock for longer, imap_rescan for one assumes its locked.
+ Fixes a race selecting the folder for refresh.
+
2004-02-23 Jeffrey Stedfast <fejj ximian com>
* camel-store.c (camel_store_uri_cmp): Removed. Useless/broken
Index: camel/providers/imap/camel-imap-command.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-command.c,v
retrieving revision 1.59
diff -u -3 -r1.59 camel-imap-command.c
--- camel/providers/imap/camel-imap-command.c 17 Jun 2003 03:20:59 -0000 1.59
+++ camel/providers/imap/camel-imap-command.c 24 Feb 2004 14:01:53 -0000
@@ -99,14 +99,11 @@
cmd = imap_command_strdup_vprintf (store, fmt, ap);
va_end (ap);
} else {
- if (store->current_folder) {
- camel_object_unref (CAMEL_OBJECT (store->current_folder));
- store->current_folder = NULL;
- }
+ camel_object_ref(folder);
+ if (store->current_folder)
+ camel_object_unref(store->current_folder);
store->current_folder = folder;
- camel_object_ref (CAMEL_OBJECT (folder));
- cmd = imap_command_strdup_printf (store, "SELECT %F",
- folder->full_name);
+ cmd = imap_command_strdup_printf (store, "SELECT %F", folder->full_name);
}
if (!imap_command_start (store, folder, cmd, ex)) {
Index: camel/providers/imap/camel-imap-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-folder.c,v
retrieving revision 1.317
diff -u -3 -r1.317 camel-imap-folder.c
--- camel/providers/imap/camel-imap-folder.c 4 Feb 2004 21:49:14 -0000 1.317
+++ camel/providers/imap/camel-imap-folder.c 24 Feb 2004 14:01:55 -0000
@@ -503,23 +503,18 @@
CAMEL_SERVICE_LOCK (imap_store, connect_lock);
if (imap_store->current_folder != folder
|| strcasecmp(folder->full_name, "INBOX") == 0) {
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
response = camel_imap_command (imap_store, folder, ex, NULL);
if (response) {
camel_imap_folder_selected (folder, response, ex);
camel_imap_response_free (imap_store, response);
}
- return;
- }
- CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
-
- /* Otherwise, if we need a rescan, do it, and if not, just do
- * a NOOP to give the server a chance to tell us about new
- * messages.
- */
- if (imap_folder->need_rescan)
+ } else if (imap_folder->need_rescan) {
+ /* Otherwise, if we need a rescan, do it, and if not, just do
+ * a NOOP to give the server a chance to tell us about new
+ * messages.
+ */
imap_rescan (folder, camel_folder_summary_count (folder->summary), ex);
- else {
+ } else {
#if 0
/* on some servers need to CHECKpoint INBOX to recieve new messages?? */
/* rfc2060 suggests this, but havent seen a server that requires it */
@@ -531,6 +526,8 @@
response = camel_imap_command (imap_store, folder, ex, "NOOP");
camel_imap_response_free (imap_store, response);
}
+
+ CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
}
/* Called with the store's connect_lock locked */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]