[evolution-ews] Do not reuse connections in the source-registry backend



commit bf3e00f00a8c60d7fd20dfc05929b962d32e6469
Author: Milan Crha <mcrha redhat com>
Date:   Thu Sep 3 18:57:36 2015 +0200

    Do not reuse connections in the source-registry backend
    
    It could happen that one connection had been reused by multiple
    backend authentication attempts, one effectively unsetting password
    for the other, causing password prompt for the EWS account.
    
    Also listen for ESource changes only after the backend is populated,
    which avoids unnecessary server pings on start.

 src/collection/e-ews-backend.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/collection/e-ews-backend.c b/src/collection/e-ews-backend.c
index b5bcb65..d09acd9 100644
--- a/src/collection/e-ews-backend.c
+++ b/src/collection/e-ews-backend.c
@@ -604,10 +604,6 @@ ews_backend_constructed (GObject *object)
        e_server_side_source_set_remote_creatable (
                E_SERVER_SIDE_SOURCE (source), TRUE);
 
-       g_signal_connect (
-               source, "changed",
-               G_CALLBACK (ews_backend_source_changed_cb), object);
-
        /* Setup the Authentication extension so
         * Camel can determine host reachability. */
        extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
@@ -672,11 +668,16 @@ ews_backend_populate (ECollectionBackend *backend)
 
        ews_backend->priv->need_update_folders = TRUE;
 
-       if (!ews_backend->priv->notify_online_id)
+       if (!ews_backend->priv->notify_online_id) {
                ews_backend->priv->notify_online_id = g_signal_connect (
                        backend, "notify::online",
                        G_CALLBACK (ews_backend_populate), NULL);
 
+               g_signal_connect (
+                       source, "changed",
+                       G_CALLBACK (ews_backend_source_changed_cb), ews_backend);
+       }
+
        /* do not do anything, if account is disabled */
        if (!e_source_get_enabled (source))
                return;
@@ -1154,7 +1155,7 @@ e_ews_backend_ref_connection_sync (EEwsBackend *backend,
 
        settings = ews_backend_get_settings (backend);
        hosturl = camel_ews_settings_dup_hosturl (settings);
-       connection = e_ews_connection_new (hosturl, settings);
+       connection = e_ews_connection_new_full (hosturl, settings, FALSE);
        g_free (hosturl);
 
        e_binding_bind_property (


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]