Changeset 2216
- Timestamp:
- 06/19/07 10:58:45
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-object.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-service.c (modified) (4 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-account-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-store-account.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r2215 r2216 2 2 3 3 * Fixed reading the unread and total counts from Maildir folders 4 * First baby steps into better connection state detection and handling 4 5 5 6 2007-06-19 Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com> trunk/libtinymail-camel/camel-lite/camel/camel-object.c
r2113 r2216 1280 1280 1281 1281 g_return_if_fail (CAMEL_IS_OBJECT (obj)); 1282 g_return_if_fail (id != 0); 1282 1283 if (id == 0) 1284 return; 1283 1285 1284 1286 if (obj->hooks == NULL) { trunk/libtinymail-camel/camel-lite/camel/camel-service.c
r2109 r2216 88 88 camel_service_class->get_name = get_name; 89 89 camel_service_class->get_path = get_path; 90 91 camel_object_class_add_event(object_class, "disconnection", NULL); 92 camel_object_class_add_event(object_class, "connection", NULL); 90 93 } 91 94 … … 111 114 camel_exception_init (&ex); 112 115 CSERV_CLASS (service)->disconnect (service, TRUE, &ex); 116 117 camel_object_trigger_event (CAMEL_OBJECT (service), 118 "disconnection", (gpointer) TRUE); 119 113 120 if (camel_exception_is_set (&ex)) { 114 121 w(g_warning ("camel_service_finalize: silent disconnect failure: %s", … … 382 389 service->connect_op = NULL; 383 390 } 391 392 camel_object_trigger_event (CAMEL_OBJECT (service), 393 "connection", NULL); 394 384 395 CAMEL_SERVICE_UNLOCK (service, connect_op_lock); 385 396 … … 444 455 camel_operation_unref (service->connect_op); 445 456 service->connect_op = NULL; 457 458 camel_object_trigger_event (CAMEL_OBJECT (service), 459 "disconnection", (gpointer) clean); 460 446 461 CAMEL_SERVICE_UNLOCK (service, connect_op_lock); 447 462 } trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c
r2214 r2216 348 348 g_return_val_if_fail(store->ostream!=NULL, NULL); 349 349 g_return_val_if_fail(store->istream!=NULL, NULL); 350 350 351 351 if (camel_stream_write (store->ostream, cmd, cmdlen) == -1 || 352 352 camel_stream_write (store->ostream, "\r\n", 2) == -1) { … … 357 357 camel_imap_recon (store, &mex); 358 358 imap_debug ("Recon in cont: %s\n", camel_exception_get_description (&mex)); 359 CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); 360 return NULL; 359 361 } else 360 362 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, … … 629 631 camel_imap_recon (store, &mex); 630 632 imap_debug ("Recon in untagged: %s\n", camel_exception_get_description (&mex)); 631 } else 633 } else { 632 634 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 633 635 g_strerror (errno)); 634 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 636 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 637 } 635 638 g_string_free (str, TRUE); 636 639 goto lose; … … 782 785 camel_imap_recon (store, &mex); 783 786 imap_debug ("Recon in untagged idle: %s\n", camel_exception_get_description (&mex)); 784 } else 787 } else { 785 788 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 786 789 g_strerror (errno)); 787 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 790 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 791 } 788 792 g_string_free (str, TRUE); 789 793 goto lose; trunk/libtinymail-camel/tny-camel-account-priv.h
r2194 r2216 64 64 TnyAccountType account_type; 65 65 gboolean custom_url_string; 66 66 guint dsid, csid; 67 67 RefreshStatusInfo *csyncop; 68 68 }; trunk/libtinymail-camel/tny-camel-store-account.c
r2194 r2216 112 112 113 113 static void 114 disconnection (CamelService *service, gpointer data, TnyAccount *self) 115 { 116 #ifdef DEBUG 117 g_print ("TNY_DEBUG: %s disconnected\n", tny_account_get_name (self)); 118 #endif 119 } 120 121 static void 122 connection (CamelService *service, gpointer data, TnyAccount *self) 123 { 124 #ifdef DEBUG 125 g_print ("TNY_DEBUG: %s connected\n", tny_account_get_name (self)); 126 #endif 127 } 128 129 static void 114 130 tny_camel_store_account_prepare (TnyCamelAccount *self) 115 131 { … … 198 214 if (apriv->service) { 199 215 apriv->service->data = self; 216 217 apriv->dsid = camel_object_hook_event (apriv->service, 218 "disconnection", (CamelObjectEventHookFunc)disconnection, self); 219 apriv->csid = camel_object_hook_event (apriv->service, 220 "connection", (CamelObjectEventHookFunc)connection, self); 221 200 222 } 201 223
