107 | 107 |
GSList *subscribed_folders;
|
108 | 108 |
|
109 | 109 |
EEwsServerVersion version;
|
|
110 |
|
|
111 |
/* Set to TRUE when this connection had been disconnected and cannot be used anymore */
|
|
112 |
gboolean disconnected_flag;
|
110 | 113 |
};
|
111 | 114 |
|
112 | 115 |
enum {
|
|
1904 | 1907 |
g_mutex_lock (&connecting);
|
1905 | 1908 |
|
1906 | 1909 |
/* remove the connection from the hash table */
|
1907 | |
if (loaded_connections_permissions != NULL) {
|
1908 | |
g_hash_table_remove (
|
1909 | |
loaded_connections_permissions, priv->hash_key);
|
|
1910 |
if (loaded_connections_permissions != NULL &&
|
|
1911 |
g_hash_table_lookup (loaded_connections_permissions, priv->hash_key) == (gpointer) object) {
|
|
1912 |
g_hash_table_remove (loaded_connections_permissions, priv->hash_key);
|
1910 | 1913 |
if (g_hash_table_size (loaded_connections_permissions) == 0) {
|
1911 | 1914 |
g_hash_table_destroy (loaded_connections_permissions);
|
1912 | 1915 |
loaded_connections_permissions = NULL;
|
|
2070 | 2073 |
|
2071 | 2074 |
cnc->priv->soup_context = g_main_context_new ();
|
2072 | 2075 |
cnc->priv->soup_loop = g_main_loop_new (cnc->priv->soup_context, FALSE);
|
|
2076 |
cnc->priv->disconnected_flag = FALSE;
|
2073 | 2077 |
|
2074 | 2078 |
cnc->priv->subscriptions = g_hash_table_new_full (
|
2075 | 2079 |
g_direct_hash, g_direct_equal,
|
|
2335 | 2339 |
loaded_connections_permissions, hash_key);
|
2336 | 2340 |
g_free (hash_key);
|
2337 | 2341 |
|
2338 | |
if (E_IS_EWS_CONNECTION (cnc)) {
|
|
2342 |
if (E_IS_EWS_CONNECTION (cnc) &&
|
|
2343 |
!e_ews_connection_get_disconnected_flag (cnc)) {
|
2339 | 2344 |
g_object_ref (cnc);
|
2340 | 2345 |
g_mutex_unlock (&connecting);
|
2341 | 2346 |
return cnc;
|
|
2369 | 2374 |
|
2370 | 2375 |
g_hash_table_iter_init (&iter, loaded_connections_permissions);
|
2371 | 2376 |
while (g_hash_table_iter_next (&iter, NULL, &value)) {
|
2372 | |
if (value)
|
|
2377 |
if (value && !e_ews_connection_get_disconnected_flag (value))
|
2373 | 2378 |
connections = g_slist_prepend (connections, g_object_ref (value));
|
2374 | 2379 |
}
|
2375 | 2380 |
}
|
|
2419 | 2424 |
cnc = g_hash_table_lookup (
|
2420 | 2425 |
loaded_connections_permissions, hash_key);
|
2421 | 2426 |
|
2422 | |
if (E_IS_EWS_CONNECTION (cnc)) {
|
|
2427 |
if (E_IS_EWS_CONNECTION (cnc) &&
|
|
2428 |
!e_ews_connection_get_disconnected_flag (cnc)) {
|
2423 | 2429 |
g_object_ref (cnc);
|
2424 | 2430 |
|
2425 | 2431 |
g_free (hash_key);
|
|
2770 | 2776 |
g_return_val_if_fail (E_IS_EWS_CONNECTION (cnc), NULL);
|
2771 | 2777 |
|
2772 | 2778 |
return g_object_ref (cnc->priv->soup_session);
|
|
2779 |
}
|
|
2780 |
|
|
2781 |
gboolean
|
|
2782 |
e_ews_connection_get_disconnected_flag (EEwsConnection *cnc)
|
|
2783 |
{
|
|
2784 |
g_return_val_if_fail (E_IS_EWS_CONNECTION (cnc), FALSE);
|
|
2785 |
|
|
2786 |
return cnc->priv->disconnected_flag;
|
|
2787 |
}
|
|
2788 |
|
|
2789 |
void
|
|
2790 |
e_ews_connection_set_disconnected_flag (EEwsConnection *cnc,
|
|
2791 |
gboolean disconnected_flag)
|
|
2792 |
{
|
|
2793 |
g_return_if_fail (E_IS_EWS_CONNECTION (cnc));
|
|
2794 |
|
|
2795 |
cnc->priv->disconnected_flag = disconnected_flag;
|
2773 | 2796 |
}
|
2774 | 2797 |
|
2775 | 2798 |
static xmlDoc *
|