summaryrefslogtreecommitdiff
path: root/camel
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2015-08-05 11:14:33 +0200
committerMilan Crha <mcrha@redhat.com>2015-08-05 11:14:33 +0200
commit425487905eb02506b8dc8215060bdbb6cd10b14c (patch)
tree505b054aca774945edd63d56d6370e8c788f3415 /camel
parente1c884e16e19fa567ed616b66c49a60e61a6cec3 (diff)
downloadevolution-data-server-425487905eb02506b8dc8215060bdbb6cd10b14c.tar.gz
[IMAPx] Stop early in imapx_authenticate_sync() if cancelled
Diffstat (limited to 'camel')
-rw-r--r--camel/providers/imapx/camel-imapx-store.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index 18572c47e..132a9f859 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -824,8 +824,20 @@ imapx_authenticate_sync (CamelService *service,
priv = CAMEL_IMAPX_STORE_GET_PRIVATE (service);
+ if (g_cancellable_set_error_if_cancelled (cancellable, error))
+ return CAMEL_AUTHENTICATION_ERROR;
+
/* This should have been set for us by connect_sync(). */
g_mutex_lock (&priv->server_lock);
+ if (!priv->connecting_server) {
+ g_mutex_unlock (&priv->server_lock);
+
+ g_set_error_literal (error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+ _("No IMAPx connection object provided"));
+
+ return CAMEL_AUTHENTICATION_ERROR;
+ }
+
imapx_server = g_object_ref (priv->connecting_server);
g_mutex_unlock (&priv->server_lock);