diff options
author | Milan Crha <mcrha@redhat.com> | 2015-08-05 11:14:33 +0200 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2015-08-05 11:14:33 +0200 |
commit | 425487905eb02506b8dc8215060bdbb6cd10b14c (patch) | |
tree | 505b054aca774945edd63d56d6370e8c788f3415 /camel | |
parent | e1c884e16e19fa567ed616b66c49a60e61a6cec3 (diff) | |
download | evolution-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.c | 12 |
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); |