2001-06-26 Dan Winship <danw@ximian.com>
- * camel-url.c (camel_url_encode): constify args
+ * providers/imap/camel-imap-folder.c (camel_imap_folder_selected,
+ imap_append_offline, imap_append_online,
+ camel_imap_folder_changed): lock the cache around accesses
+
+ * providers/imap/camel-imap-store.c (get_folder_online): ref the
+ newly-created folder (as current_folder) before calling
+ camel_imap_folder_selected, in case that needs to do something
+ that causes another folder to become current...
+
+ * camel-service.c (camel_service_get_url): D'oh.
+ s/FALSE/CAMEL_URL_HIDE_PASSWORD/
2001-06-25 Jeffrey Stedfast <fejj@ximian.com>
#include "camel-imap-folder.h"
#include "camel-imap-command.h"
#include "camel-imap-message-cache.h"
+#include "camel-imap-private.h"
#include "camel-imap-search.h"
#include "camel-imap-store.h"
#include "camel-imap-summary.h"
#include "camel-data-wrapper.h"
#include "camel-disco-diary.h"
#include "camel-exception.h"
-#include "camel-imap-private.h"
#include "camel-mime-filter-crlf.h"
#include "camel-mime-filter-from.h"
#include "camel-mime-message.h"
else if (validity != imap_summary->validity) {
imap_summary->validity = validity;
camel_folder_summary_clear (folder->summary);
+ CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
camel_imap_message_cache_clear (imap_folder->cache);
+ CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
imap_folder->need_rescan = FALSE;
camel_imap_folder_changed (folder, exists, NULL, ex);
return;
CAMEL_IMAP_STORE_UNLOCK (imap_store, command_lock);
camel_imap_summary_add_offline (folder->summary, uid, message, info);
+ CAMEL_IMAP_FOLDER_LOCK (folder, cache_lock);
camel_imap_message_cache_insert_wrapper (cache, uid, "",
CAMEL_DATA_WRAPPER (message));
+ CAMEL_IMAP_FOLDER_UNLOCK (folder, cache_lock);
changes = camel_folder_change_info_new ();
camel_folder_change_info_add_uid (changes, uid);
/* Cache first, since freeing response may trigger a
* summary update that will want this information.
*/
+ CAMEL_IMAP_FOLDER_LOCK (folder, cache_lock);
camel_imap_message_cache_insert_wrapper (
CAMEL_IMAP_FOLDER (folder)->cache,
uid, "", CAMEL_DATA_WRAPPER (message));
+ CAMEL_IMAP_FOLDER_UNLOCK (folder, cache_lock);
g_free (uid);
}
id = g_array_index (expunged, int, i);
info = camel_folder_summary_index (folder->summary, id - 1);
camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
- /* It's safe to not lock around this. */
+ CAMEL_IMAP_FOLDER_LOCK (imap_folder, cache_lock);
camel_imap_message_cache_remove (imap_folder->cache, camel_message_info_uid (info));
+ CAMEL_IMAP_FOLDER_UNLOCK (imap_folder, cache_lock);
camel_folder_summary_remove (folder->summary, info);
camel_folder_summary_info_free(folder->summary, info);
}
g_free (folder_dir);
if (new_folder) {
imap_store->current_folder = new_folder;
+ camel_object_ref (CAMEL_OBJECT (new_folder));
camel_imap_folder_selected (new_folder, response, ex);
if (camel_exception_is_set (ex)) {
+ camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
+ imap_store->current_folder = NULL;
camel_object_unref (CAMEL_OBJECT (new_folder));
- new_folder = imap_store->current_folder = NULL;
- } else
- camel_object_ref (CAMEL_OBJECT (imap_store->current_folder));
+ new_folder = NULL;
+ }
}
camel_imap_response_free_without_processing (imap_store, response);