Changeset 3827

Show
Ignore:
Timestamp:
11/26/08 09:52:50
Author:
svillar
Message:

IDLE fixes for the case when connection fails

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c

    r3809 r3827  
    39183918                         
    39193919                        nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 
    3920                         idle_debug ("(%d, 8) -> DONE\n", nwritten); 
    3921  
    3922                         /* We read away everything the server sends 
    3923                          * until the we see the untagged OK response */ 
    3924  
    3925                         process_idle_untagged_response (store, folder, idle_resp, ex); 
     3920                        /* if we fail to send done, then we shouldn't wait for done response. 
     3921                         * It can happen, for example, if sending idle connection failed too */ 
     3922                        if (nwritten > 0) { 
     3923                                idle_debug ("(%d, 8) -> DONE\n", nwritten); 
     3924 
     3925                                /* We read away everything the server sends 
     3926                                 * until the we see the untagged OK response */ 
     3927 
     3928                                process_idle_untagged_response (store, folder, idle_resp, ex); 
     3929                                store->idle_kill = TRUE; 
     3930                                store->idle_cont = FALSE; 
     3931                        } 
    39263932                } 
    39273933 
  • releases/modest/diablo-pe2/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r3801 r3827  
    221221let_idle_die (CamelImapStore *store, gboolean connect_buz) 
    222222{ 
     223 
     224        if (store->idle_thread != NULL && g_thread_self () == store->idle_thread) { 
     225                idle_debug ("Called let_idle_die from idle thread\n"); 
     226                return; 
     227        } 
    223228 
    224229        idle_debug ("let_idle_die starts\n"); 
     
    41034108        CamelFolderInfo *tree = NULL; 
    41044109 
    4105         g_static_rec_mutex_lock (imap_store->sum_lock); 
    4106  
    41074110        if (top == NULL) 
    41084111                top = ""; 
    41094112 
    41104113        camel_imap_store_stop_idle_connect_lock (imap_store); 
     4114 
     4115        g_static_rec_mutex_lock (imap_store->sum_lock); 
    41114116 
    41124117        if (imap_store->going_online || !imap_store->got_online) 
     
    42094214        } 
    42104215 
     4216fail: 
     4217        tree = get_folder_info_offline (store, top, flags, ex); 
     4218 
     4219        g_static_rec_mutex_unlock (imap_store->sum_lock); 
     4220 
    42114221        camel_imap_store_connect_unlock_start_idle (imap_store); 
    42124222 
    4213         tree = get_folder_info_offline(store, top, flags, ex); 
    4214  
    4215         g_static_rec_mutex_unlock (imap_store->sum_lock); 
    4216         return tree; 
    4217  
    4218 fail: 
    4219         camel_imap_store_connect_unlock_start_idle (imap_store); 
    4220  
    4221         tree = get_folder_info_offline (store, top, flags, ex); 
    4222  
    4223         g_static_rec_mutex_unlock (imap_store->sum_lock); 
    42244223        return tree; 
    42254224}