aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-store.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-16 11:54:45 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-16 11:54:45 +0800
commite3a451cb33cad9dada930fd5111bcc6c341d5a2b (patch)
tree3bee6ca799aa5e36d8c6d1a0474ab7091e688a2e /camel/providers/imap/camel-imap-store.c
parente202430d41d6b793e94d7ac0d252de826e80991b (diff)
downloadgsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar
gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.gz
gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.bz2
gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.lz
gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.xz
gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.zst
gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.zip
Chganged len back to be unsigned. And do a simple range check on the
2001-01-16 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_decode_string): Chganged len back to be unsigned. And do a simple range check on the string value to try and detect corrupted summary files. * providers/imap/camel-imap-command.c (imap_read_untagged): Handle cancelled stream reads with an appropriate exception. * providers/imap/camel-imap-private.h: Fix the include-once macro. Doh, confliced with camel-private.h. * providers/imap/camel-imap-store.c (imap_store_refresh_folders): A copy of camel_remote_store_refresh_folders. We avoid locking each folder when we call it though. This should be removed when i can work out how to remove the folder lock from this function easily. * camel-stream-fs.c (stream_write): Fix n' argument of select. (stream_read): Likewise. * camel-remote-store.c (socket_connect): Bump the connect timeout upto 4 minutes. (socket_connect): Oops, fix the 'n' argument of select. * camel-session.c (camel_cancel_cancel): If we are given no cancellation node, then do it for all active ones. svn path=/trunk/; revision=7526
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r--camel/providers/imap/camel-imap-store.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index ca4ca2e0d7..275270ecb6 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -48,6 +48,7 @@
#include "string-utils.h"
#include "camel-imap-private.h"
+#include "camel-private.h"
#define d(x) x
@@ -283,6 +284,31 @@ query_auth_types (CamelService *service, CamelException *ex)
return g_list_prepend (types, &password_authtype);
}
+/* call refresh folder directly, bypassing the folder lock */
+static void
+refresh_folder_info (gpointer key, gpointer value, gpointer data)
+{
+ CamelFolder *folder = CAMEL_FOLDER (value);
+
+ CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->refresh_info(folder, data);
+}
+
+/* This is a little 'hack' to avoid the deadlock conditions that would otherwise
+ ensue when calling camel_folder_refresh_info from inside a lock */
+/* NB: on second thougts this is probably not entirely safe, but it'll do for now */
+/* the alternative is to:
+ make the camel folder->lock recursive (which should probably be done)
+ or remove it from camel_folder_refresh_info, and use another locking mechanism */
+static void
+imap_store_refresh_folders (CamelRemoteStore *store, CamelException *ex)
+{
+ CAMEL_STORE_LOCK(store, cache_lock);
+
+ g_hash_table_foreach (CAMEL_STORE (store)->folders, refresh_folder_info, ex);
+
+ CAMEL_STORE_UNLOCK(store, cache_lock);
+}
+
static gboolean
imap_connect (CamelService *service, CamelException *ex)
{
@@ -476,7 +502,7 @@ imap_connect (CamelService *service, CamelException *ex)
return FALSE;
}
- camel_remote_store_refresh_folders (CAMEL_REMOTE_STORE (store), ex);
+ imap_store_refresh_folders (CAMEL_REMOTE_STORE (store), ex);
return !camel_exception_is_set (ex);
}