Changeset 1921
- Timestamp:
- 05/08/07 20:13:04
- Files:
-
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (15 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-header-list-model.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r1920 r1921 3266 3266 CamelException ex = CAMEL_EXCEPTION_INITIALISER; 3267 3267 3268 idle_debug ("process_idle_response\n"); 3269 3268 3270 if (!idle_resp) 3269 3271 return; … … 3320 3322 char *ptr = strchr (resp, '*'); 3321 3323 3324 idle_debug ("read_idle_response\n"); 3325 3322 3326 if (ptr && strstr (resp, "EXISTS") != NULL) 3323 3327 idle_resp->exists = strtoul (resp + 1, NULL, 10); … … 3354 3358 { 3355 3359 IdleResponse *idle_resp = g_slice_new0 (IdleResponse); 3360 3361 idle_debug ("idle_response_new\n"); 3362 3356 3363 idle_resp->folder = folder; 3357 3364 camel_object_ref (CAMEL_OBJECT (folder)); … … 3362 3369 idle_response_free (IdleResponse *idle_resp) 3363 3370 { 3371 idle_debug ("idle_response_free\n"); 3372 3364 3373 guint i=0; 3365 3374 … … 3380 3389 idle_real_start (CamelImapStore *store) 3381 3390 { 3391 idle_debug ("idle_real_start\n"); 3392 3382 3393 g_mutex_lock (store->stream_lock); 3383 3394 store->idle_prefix = g_strdup_printf ("%c%.5u", … … 3398 3409 CamelImapResponseType type; 3399 3410 gboolean locked; 3411 3412 3413 idle_debug ("idle_deal_with_stuff\n"); 3400 3414 3401 3415 if (!folder || !CAMEL_IS_IMAP_FOLDER (folder)) … … 3447 3461 if (store->ostream == NULL || ((CamelObject *)store->istream)->ref_count <= 0) 3448 3462 { g_mutex_unlock (store->stream_lock); return NULL; } 3449 if (store->ostream && CAMEL_IS_STREAM (store->ostream)) 3463 if (store->ostream && CAMEL_IS_STREAM (store->ostream)) { 3464 idle_debug ("Sending DONE in idle_deal_with_stuff (nb)\n"); 3450 3465 nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 3466 } 3451 3467 g_mutex_unlock (store->stream_lock); 3452 3468 … … 3483 3499 if (store->ostream == NULL || ((CamelObject *)store->istream)->ref_count <= 0) 3484 3500 { g_mutex_unlock (store->stream_lock); return NULL; } 3485 if (store->ostream && CAMEL_IS_STREAM (store->ostream)) 3501 if (store->ostream && CAMEL_IS_STREAM (store->ostream)) { 3502 idle_debug ("Sending DONE in idle_deal_with_stuff (b)\n"); 3486 3503 nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 3504 } 3487 3505 g_mutex_unlock (store->stream_lock); 3488 3506 if (nwritten == -1) … … 3511 3529 CamelException ex = CAMEL_EXCEPTION_INITIALISER; 3512 3530 3531 idle_debug ("camel_imap_folder_stop_idle\n"); 3532 3513 3533 if (!folder || !CAMEL_IS_IMAP_FOLDER (folder)) 3514 3534 return; … … 3527 3547 g_static_rec_mutex_lock (((CamelImapFolder *)folder)->idle_lock); 3528 3548 3529 if ( store->capabilities & IMAP_CAPABILITY_IDLE)3549 if ((store->capabilities & IMAP_CAPABILITY_IDLE) && store->idle_prefix) 3530 3550 { 3531 3551 gboolean hadlock = FALSE; … … 3554 3574 idle_timeout_checker_destroy (gpointer data) 3555 3575 { 3556 /* printf ("got destroyed\n"); */ 3576 idle_debug ("idle_timeout_checker_destroy\n"); 3577 3557 3578 return; 3558 3579 } … … 3569 3590 ((CamelImapFolder *)folder)->in_idle = TRUE; 3570 3591 3571 /* printf ("idle\n"); */3592 idle_debug ("idle_timeout_checker\n"); 3572 3593 3573 3594 if ((!folder) || ((((CamelObject *)data)->ref_count <= 0) && (!CAMEL_IS_IMAP_FOLDER (folder)))) … … 3602 3623 if (hadlock) 3603 3624 idle_real_start (store); 3604 3605 3625 if (idle_resp) 3606 3626 idle_response_free (idle_resp); … … 3630 3650 CamelImapFolder *imap_folder = (CamelImapFolder *) folder; 3631 3651 CamelException ex = CAMEL_EXCEPTION_INITIALISER; 3652 3653 idle_debug ("camel_imap_folder_start_idle\n"); 3632 3654 3633 3655 if (!folder || !CAMEL_IS_IMAP_FOLDER (folder)) … … 3654 3676 idle_real_start (store); 3655 3677 3656 store->idle_signal = g_timeout_add_full ( 5 * 1000, G_PRIORITY_DEFAULT_IDLE,3678 store->idle_signal = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 5 * 1000, 3657 3679 idle_timeout_checker, folder, idle_timeout_checker_destroy); 3658 3680 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r1920 r1921 150 150 imap_store->idle_prefix=NULL; 151 151 g_mutex_lock (imap_store->stream_lock); 152 idle_debug ("Sending DONE in let_idle_die\n"); 152 153 camel_stream_printf (imap_store->ostream, "DONE\r\n"); 153 154 g_mutex_unlock (imap_store->stream_lock); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h
r1843 r1921 26 26 #define CAMEL_IMAP_STORE_H 1 27 27 28 /* #define IDLE_DEBUG 1 */ 29 30 #ifdef IDLE_DEBUG 31 #define idle_debug(o) printf ("%s\n", o) 32 #else 33 #define idle_debug(o) 34 #endif 28 35 29 36 #ifdef __cplusplus trunk/libtinymailui-gtk/tny-gtk-header-list-model.c
r1920 r1921 589 589 } 590 590 591 me->add_timeout = g_timeout_add_full ( 1000, G_PRIORITY_DEFAULT_IDLE,591 me->add_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,1000, 592 592 notify_views_add, me, notify_views_add_destroy); 593 593 } … … 697 697 stuff->loop = g_main_loop_new (NULL, FALSE); 698 698 699 src = g_timeout_add_full ( 0, G_PRIORITY_HIGH_IDLE,699 src = g_timeout_add_full (G_PRIORITY_HIGH_IDLE, 0, 700 700 notify_views_delete, stuff, notify_views_delete_destroy); 701 701 stuff->src = (gint) add_del_timeout (me, src);
