Changeset 2816
- Timestamp:
- 10/04/07 20:02:41
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-mime-part.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-send-queue.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r2815 r2816 3 3 - -Wall warnings 4 4 - -pedantic warnings 5 - TnyCamelSendQueue should not error if the TnyDevice went offline 5 6 6 7 2007-10-03 Jose Dapena Paz <jdapena@igalia.com> trunk/libtinymail-camel/camel-lite/camel/camel-mime-part.c
r2815 r2816 115 115 g_hash_table_insert (header_name_table, "Content-Type", (gpointer)HEADER_CONTENT_TYPE); 116 116 117 header_formatted_table = g_hash_table_new (camel_strcase_hash, (gpointer)camel_strcase_equal);117 header_formatted_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal); 118 118 g_hash_table_insert(header_formatted_table, "Content-Type", (gpointer)write_raw); 119 119 g_hash_table_insert(header_formatted_table, "Content-Disposition", (gpointer)write_raw); trunk/libtinymail-camel/tny-camel-send-queue.c
r2769 r2816 25 25 #include <tny-camel-shared.h> 26 26 #include <tny-camel-msg.h> 27 #include <tny-device.h> 27 28 #include <tny-simple-list.h> 28 29 #include <tny-folder.h> … … 267 268 guint i = 0, length = 0; 268 269 TnyList *list = NULL; 270 TnyCamelAccountPriv *apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->trans_account); 271 TnySessionCamelPriv *spriv = TNY_SESSION_CAMEL (apriv->session)->priv; 272 TnyDevice *device = g_object_ref (spriv->device); 269 273 270 274 g_object_ref (self); /* My own reference */ … … 298 302 priv->do_continue = TRUE; 299 303 300 while (length > 0 && priv->do_continue )304 while (length > 0 && priv->do_continue && tny_device_is_online (device)) 301 305 { 302 306 TnyHeader *header = NULL; … … 313 317 TnyIterator *giter = NULL; 314 318 315 tny_folder_get_headers (outbox, headers, TRUE, &ferror); 319 if (tny_device_is_online (device)) 320 tny_folder_get_headers (outbox, headers, TRUE, &ferror); 321 else { 322 priv->is_running = FALSE; 323 g_mutex_unlock (priv->todo_lock); 324 g_mutex_unlock (priv->sending_lock); 325 goto errorhandler; 326 } 316 327 317 328 if (ferror != NULL) … … 368 379 g_mutex_unlock (priv->todo_lock); 369 380 370 if (header && TNY_IS_HEADER (header) )381 if (header && TNY_IS_HEADER (header) && tny_device_is_online (device)) 371 382 { 372 383 TnyList *hassent = tny_simple_list_new (); … … 387 398 priv->do_continue = FALSE; 388 399 } 389 } else {400 } else { 390 401 emit_error (self, header, msg, err, i, priv->total); 391 402 priv->do_continue = FALSE; … … 408 419 } 409 420 } 421 g_mutex_unlock (priv->todo_lock); 410 422 411 423 /* Emits msg-sent signal to inform msg has been sent */ 412 /* This now happens in on_msg_sent_get_msg! 413 414 if (priv->do_continue) 415 emit_control (self, header, msg, TNY_SEND_QUEUE_MSG_SENT, i, priv->total); */ 416 417 g_mutex_unlock (priv->todo_lock); 424 /* This now happens in on_msg_sent_get_msg! */ 418 425 419 426 g_object_unref (hassent); … … 429 436 { 430 437 priv->is_running = FALSE; 431 /* Not good, let's just kill this thread */438 /* Not good, or we just went offline, let's just kill this thread */ 432 439 length = 0; 433 440 if (header && G_IS_OBJECT (header)) 434 441 g_object_unref (header); 442 g_mutex_unlock (priv->sending_lock); 443 break; 435 444 } 436 445 … … 445 454 priv->is_running = FALSE; 446 455 456 g_object_unref (device); 447 457 g_object_unref (sentbox); 448 458 g_object_unref (outbox); … … 572 582 if (priv->total >= 1 && !priv->is_running) 573 583 create_worker (info->self); 574 575 584 if (info->self) 576 585 g_object_unref (info->self); … … 725 734 mdstore = camel_session_get_store(session, full_path, &ex); 726 735 727 /* mdstore = _tny_camel_account_get_service (TNY_CAMEL_ACCOUNT (priv->trans_account)); */728 729 736 if (!camel_exception_is_set (&ex) && mdstore) 730 737 { … … 735 742 { 736 743 CamelFolderInfo *iter; 737 738 /* camel_object_unref (CAMEL_OBJECT (cfolder)); */739 744 740 745 iter = camel_store_get_folder_info (mdstore, name, … … 913 918 914 919 priv = TNY_CAMEL_SEND_QUEUE_GET_PRIVATE (self); 915 if (priv->trans_account) { 920 921 if (priv->trans_account) 922 { 916 923 apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->trans_account); 917 924 _tny_session_camel_unreg_queue (apriv->session, self); 918 925 919 g_object_unref ( G_OBJECT(priv->trans_account));926 g_object_unref (priv->trans_account); 920 927 921 928 if (priv->signal != -1) … … 926 933 priv->signal = (gint) g_signal_connect (G_OBJECT (trans_account), 927 934 "set-online-happened", G_CALLBACK (on_setonline_happened), self); 928 priv->trans_account = TNY_TRANSPORT_ACCOUNT (g_object_ref( G_OBJECT(trans_account)));935 priv->trans_account = TNY_TRANSPORT_ACCOUNT (g_object_ref(trans_account)); 929 936 apriv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (priv->trans_account); 930 937 _tny_session_camel_reg_queue (apriv->session, self); … … 953 960 if (!priv->trans_account) 954 961 return NULL; 955 g_object_ref ( G_OBJECT(priv->trans_account));962 g_object_ref (priv->trans_account); 956 963 957 964 return TNY_CAMEL_TRANSPORT_ACCOUNT(priv->trans_account);
