Changeset 3439
- Timestamp:
- 03/01/08 13:23:38
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/docs/devel/reference/tmpl/tny-account-store.sgml (modified) (1 diff)
- trunk/docs/devel/reference/tmpl/tny-account.sgml (modified) (1 diff)
- trunk/docs/devel/reference/tmpl/tny-device.sgml (modified) (1 diff)
- trunk/docs/devel/reference/tmpl/tny-send-queue.sgml (modified) (5 diffs)
- trunk/docs/devel/reference/tmpl/tny-shared.sgml (modified) (4 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-engine.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c (modified) (9 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-send-queue-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-send-queue.c (modified) (27 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3437 r3439 1 2008-03-01 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Fixes in the POP code for POP servers that return invalid CAPA 4 responses (like pop.sina.com) 5 1 6 2008-02-28 Jose Dapena Paz <jdapena@igalia.com> 2 7 trunk/docs/devel/reference/tmpl/tny-account-store.sgml
r3415 r3439 49 49 50 50 </para> 51 52 @:53 51 54 52 @tnyaccountstore: the object which received the signal. trunk/docs/devel/reference/tmpl/tny-account.sgml
r3415 r3439 28 28 29 29 </para> 30 31 @: 30 32 31 33 @tnyaccount: the object which received the signal. trunk/docs/devel/reference/tmpl/tny-device.sgml
r3415 r3439 36 36 37 37 </para> 38 39 @:40 @:41 38 42 39 @tnydevice: the object which received the signal. trunk/docs/devel/reference/tmpl/tny-send-queue.sgml
r3415 r3439 40 40 </para> 41 41 42 @: 43 @: 44 @: 45 @: 46 42 47 @tnysendqueue: the object which received the signal. 43 48 @arg1: … … 49 54 50 55 </para> 56 57 @: 58 @: 59 @: 60 @: 61 @: 51 62 52 63 @tnysendqueue: the object which received the signal. … … 61 72 </para> 62 73 74 @: 75 @: 76 @: 77 @: 78 @: 79 63 80 @tnysendqueue: the object which received the signal. 64 81 @arg1: … … 72 89 </para> 73 90 74 @:75 76 91 @tnysendqueue: the object which received the signal. 77 92 … … 80 95 81 96 </para> 82 83 @:84 97 85 98 @tnysendqueue: the object which received the signal. trunk/docs/devel/reference/tmpl/tny-shared.sgml
r3415 r3439 54 54 </para> 55 55 56 @ tnyaccountstore: the object which received the signal.56 @: 57 57 58 58 <!-- ##### STRUCT TnyAccountStoreIface ##### --> … … 262 262 </para> 263 263 264 @ :264 @tnyaccount: the object which received the signal. 265 265 266 266 <!-- ##### SIGNAL TnyAccount::connection-status-changed ##### --> … … 321 321 </para> 322 322 323 @ tnydevice: the object which received the signal.324 @ arg1:323 @: 324 @: 325 325 326 326 <!-- ##### STRUCT TnyDeviceIface ##### --> … … 493 493 </para> 494 494 495 @tnysendqueue: the object which received the signal. 496 @arg1: 497 @arg2: 498 @arg3: 499 500 <!-- ##### SIGNAL TnySendQueue::msg-sending ##### --> 501 <para> 502 503 </para> 504 505 @tnysendqueue: the object which received the signal. 506 @arg1: 507 @arg2: 508 @arg3: 509 @arg4: 510 511 <!-- ##### SIGNAL TnySendQueue::msg-sent ##### --> 512 <para> 513 514 </para> 515 516 @tnysendqueue: the object which received the signal. 517 @arg1: 518 @arg2: 519 @arg3: 520 @arg4: 521 522 <!-- ##### SIGNAL TnySendQueue::queue-start ##### --> 523 <para> 524 525 </para> 526 495 527 @: 528 529 <!-- ##### SIGNAL TnySendQueue::queue-stop ##### --> 530 <para> 531 532 </para> 533 496 534 @: 497 @:498 @:499 500 <!-- ##### SIGNAL TnySendQueue::msg-sending ##### -->501 <para>502 503 </para>504 505 @:506 @:507 @:508 @:509 @:510 511 <!-- ##### SIGNAL TnySendQueue::msg-sent ##### -->512 <para>513 514 </para>515 516 @:517 @:518 @:519 @:520 @:521 522 <!-- ##### SIGNAL TnySendQueue::queue-start ##### -->523 <para>524 525 </para>526 527 @tnysendqueue: the object which received the signal.528 529 <!-- ##### SIGNAL TnySendQueue::queue-stop ##### -->530 <para>531 532 </para>533 534 @tnysendqueue: the object which received the signal.535 535 536 536 <!-- ##### STRUCT TnySendQueueIface ##### --> trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-engine.c
r3235 r3439 295 295 camel_pop3_engine_command_free (pe, pc); 296 296 } 297 298 if (pe->capa == 0) { 299 /* Ugly assumptions */ 300 pe->capa |= CAMEL_POP3_CAP_TOP; 301 } 297 302 } 298 303 trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c
r3427 r3439 183 183 h = camel_mime_parser_headers_raw(mp); 184 184 while (h) { 185 if ( g_ascii_strcasecmp(h->name, "status") != 0185 if (h->name && g_ascii_strcasecmp(h->name, "status") != 0 186 186 && g_ascii_strcasecmp(h->name, "x-status") != 0) { 187 187 md5_update(&md5, (const guchar*) h->name, strlen(h->name)); … … 357 357 } 358 358 359 if (pop3_store->engine && pop3_store->engine->capa & CAMEL_POP3_CAP_TOP) 359 if (pop3_store->engine && pop3_store->engine->capa & CAMEL_POP3_CAP_TOP) { 360 360 msg = pop3_get_top (folder, fi->uid, NULL); 361 else if (pop3_store->engine) 362 msg = pop3_get_message (folder, fi->uid, CAMEL_FOLDER_RECEIVE_PARTIAL, -1, NULL); 361 if (!msg && (!(pop3_store->engine->capa & CAMEL_POP3_CAP_TOP))) 362 msg = pop3_get_message (folder, fi->uid, CAMEL_FOLDER_RECEIVE_FULL, -1, NULL); 363 } else if (pop3_store->engine) 364 msg = pop3_get_message (folder, fi->uid, CAMEL_FOLDER_RECEIVE_FULL, -1, NULL); 363 365 364 366 g_static_rec_mutex_unlock (pop3_store->eng_lock); … … 456 458 { 457 459 CamelPOP3FolderInfo *fi2 = pop3_store->uids->pdata[t]; 458 if ( fi2 && fi2->uid && !strcmp (fi2->uid, info->uid)) {460 if (info && fi2 && fi2->uid && info->uid && !strcmp (fi2->uid, info->uid)) { 459 461 found = TRUE; 460 462 break; … … 603 605 { 604 606 CamelPOP3FolderInfo *fi2 = pop3_store->uids->pdata[t]; 605 if ( fi2 && fi2->uid && !strcmp (fi2->uid, info->uid)) {607 if (info && fi2 && fi2->uid && info->uid && !strcmp (fi2->uid, info->uid)) { 606 608 found = TRUE; 607 609 break; … … 756 758 757 759 /* heuristics */ 758 if ( camel_strstrcase (buffer, "Content-Disposition: attachment") != NULL)760 if (buffer && camel_strstrcase (buffer, "Content-Disposition: attachment") != NULL) 759 761 fi->has_attachments = TRUE; 760 else if ( camel_strstrcase (buffer, "filename=") != NULL &&762 else if (buffer && camel_strstrcase (buffer, "filename=") != NULL && 761 763 strchr (buffer, '.')) 762 764 fi->has_attachments = TRUE; 763 else if ( camel_strstrcase (buffer, "Content-Type: message/rfc822") != NULL)765 else if (buffer && camel_strstrcase (buffer, "Content-Type: message/rfc822") != NULL) 764 766 fi->has_attachments = TRUE; 765 767 … … 817 819 818 820 /* heuristics */ 819 if ( camel_strstrcase ((const char *) buffer, "Content-Disposition: attachment") != NULL)821 if (buffer && camel_strstrcase ((const char *) buffer, "Content-Disposition: attachment") != NULL) 820 822 fi->has_attachments = TRUE; 821 else if ( camel_strstrcase ((const char *) buffer, "filename=") != NULL &&823 else if (buffer && camel_strstrcase ((const char *) buffer, "filename=") != NULL && 822 824 strchr ((const char *) buffer, '.')) 823 825 fi->has_attachments = TRUE; 824 else if ( camel_strstrcase ((const char *) buffer, "Content-Type: message/rfc822") != NULL)826 else if (buffer && camel_strstrcase ((const char *) buffer, "Content-Type: message/rfc822") != NULL) 825 827 fi->has_attachments = TRUE; 826 828 827 if (boundary == NULL )829 if (boundary == NULL && buffer) 828 830 { 829 831 CamelContentType *ct = NULL; … … 844 846 boundary = g_strdup (bound); 845 847 } 846 } else if ( strstr ((const char*) buffer, (const char*) boundary))848 } else if (buffer && strstr ((const char*) buffer, (const char*) boundary)) 847 849 { 848 850 if (occurred) … … 858 860 } 859 861 860 if (!theend )862 if (!theend && buffer) 861 863 { 862 864 n = camel_stream_write(fi->stream, (const char*) buffer, len); … … 1411 1413 if (i == -1) 1412 1414 fi->err = errno; 1415 1416 if (pcr->state == CAMEL_POP3_COMMAND_ERR) { 1417 fi->err = -1; 1418 pop3_store->engine->capa &= ~CAMEL_POP3_CAP_TOP; 1419 } 1420 1413 1421 camel_pop3_engine_command_free(pop3_store->engine, pcr); 1414 1422 trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c
r3301 r3439 861 861 camel_pop3_engine_command_free(store->engine, pcu); 862 862 863 /* camel_pop3_engine_reget_capabilities (store->engine); */ 864 863 865 return status; 864 866 } trunk/libtinymail-camel/tny-camel-send-queue-priv.h
r3425 r3439 33 33 gint signal; 34 34 GThread *thread; 35 G Mutex *todo_lock, *sending_lock;35 GStaticRecMutex *todo_lock, *sending_lock; 36 36 gboolean do_continue, is_running; 37 37 gboolean observer_attached; trunk/libtinymail-camel/tny-camel-send-queue.c
r3425 r3439 347 347 list = tny_simple_list_new (); 348 348 349 g_ mutex_lock (priv->todo_lock);349 g_static_rec_mutex_lock (priv->todo_lock); 350 350 { 351 351 GError *terror = NULL; … … 363 363 "software."); 364 364 priv->is_running = FALSE; 365 g_ mutex_unlock (priv->todo_lock);365 g_static_rec_mutex_unlock (priv->todo_lock); 366 366 goto errorhandler; 367 367 } … … 374 374 g_error_free (terror); 375 375 g_object_unref (list); 376 g_ mutex_unlock (priv->todo_lock);376 g_static_rec_mutex_unlock (priv->todo_lock); 377 377 goto errorhandler; 378 378 } … … 381 381 priv->total = length; 382 382 } 383 g_ mutex_unlock (priv->todo_lock);383 g_static_rec_mutex_unlock (priv->todo_lock); 384 384 385 385 g_object_unref (list); … … 392 392 TnyMsg *msg = NULL; 393 393 394 g_ mutex_lock (priv->sending_lock);395 396 g_ mutex_lock (priv->todo_lock);394 g_static_rec_mutex_lock (priv->sending_lock); 395 396 g_static_rec_mutex_lock (priv->todo_lock); 397 397 { 398 398 GError *ferror = NULL; … … 406 406 else { 407 407 priv->is_running = FALSE; 408 g_ mutex_unlock (priv->todo_lock);409 g_ mutex_unlock (priv->sending_lock);408 g_static_rec_mutex_unlock (priv->todo_lock); 409 g_static_rec_mutex_unlock (priv->sending_lock); 410 410 goto errorhandler; 411 411 } … … 417 417 g_error_free (ferror); 418 418 g_object_unref (headers); 419 g_ mutex_unlock (priv->todo_lock);420 g_ mutex_unlock (priv->sending_lock);419 g_static_rec_mutex_unlock (priv->todo_lock); 420 g_static_rec_mutex_unlock (priv->sending_lock); 421 421 goto errorhandler; 422 422 } … … 457 457 priv->is_running = FALSE; 458 458 g_object_unref (headers); 459 g_ mutex_unlock (priv->todo_lock);460 g_ mutex_unlock (priv->sending_lock);459 g_static_rec_mutex_unlock (priv->todo_lock); 460 g_static_rec_mutex_unlock (priv->sending_lock); 461 461 break; 462 462 } … … 468 468 g_object_unref (headers); 469 469 } 470 g_ mutex_unlock (priv->todo_lock);470 g_static_rec_mutex_unlock (priv->todo_lock); 471 471 472 472 if (header && TNY_IS_HEADER (header) && tny_device_is_online (device)) … … 501 501 } 502 502 503 g_ mutex_lock (priv->todo_lock);503 g_static_rec_mutex_lock (priv->todo_lock); 504 504 { 505 505 if (err == NULL) … … 516 516 } 517 517 } 518 g_ mutex_unlock (priv->todo_lock);518 g_static_rec_mutex_unlock (priv->todo_lock); 519 519 520 520 /* Emits msg-sent signal to inform msg has been sent */ … … 537 537 if (header && G_IS_OBJECT (header)) 538 538 g_object_unref (header); 539 g_ mutex_unlock (priv->sending_lock);539 g_static_rec_mutex_unlock (priv->sending_lock); 540 540 break; 541 541 } 542 542 543 g_ mutex_unlock (priv->sending_lock);543 g_static_rec_mutex_unlock (priv->sending_lock); 544 544 545 545 } … … 611 611 TnyIterator *iter; 612 612 613 g_ mutex_lock (priv->sending_lock);613 g_static_rec_mutex_lock (priv->sending_lock); 614 614 615 615 priv->is_running = FALSE; … … 623 623 g_object_unref (headers); 624 624 g_object_unref (outbox); 625 g_ mutex_unlock (priv->sending_lock);625 g_static_rec_mutex_unlock (priv->sending_lock); 626 626 return; 627 627 } … … 644 644 g_object_unref (headers); 645 645 g_object_unref (outbox); 646 g_ mutex_unlock (priv->sending_lock);646 g_static_rec_mutex_unlock (priv->sending_lock); 647 647 return; 648 648 } … … 657 657 g_object_unref (outbox); 658 658 659 g_ mutex_unlock (priv->sending_lock);659 g_static_rec_mutex_unlock (priv->sending_lock); 660 660 661 661 return; … … 715 715 g_assert (TNY_IS_CAMEL_MSG (msg)); 716 716 717 g_ mutex_lock (priv->todo_lock);717 g_static_rec_mutex_lock (priv->todo_lock); 718 718 { 719 719 TnyFolder *outbox; … … 731 731 "This problem indicates a bug in the software.")); 732 732 g_object_unref (headers); 733 g_ mutex_unlock (priv->todo_lock);733 g_static_rec_mutex_unlock (priv->todo_lock); 734 734 return; 735 735 } … … 741 741 g_object_unref (headers); 742 742 g_object_unref (outbox); 743 g_ mutex_unlock (priv->todo_lock);743 g_static_rec_mutex_unlock (priv->todo_lock); 744 744 return; 745 745 } … … 757 757 g_object_unref (outbox); 758 758 } 759 g_ mutex_unlock (priv->todo_lock);759 g_static_rec_mutex_unlock (priv->todo_lock); 760 760 761 761 return; … … 778 778 g_assert (TNY_IS_CAMEL_MSG (msg)); 779 779 780 g_ mutex_lock (priv->todo_lock);780 g_static_rec_mutex_lock (priv->todo_lock); 781 781 { 782 782 TnyFolder *outbox; … … 794 794 "This problem indicates a bug in the software.")); 795 795 g_object_unref (headers); 796 g_ mutex_unlock (priv->todo_lock);796 g_static_rec_mutex_unlock (priv->todo_lock); 797 797 return; 798 798 } … … 804 804 g_object_unref (headers); 805 805 g_object_unref (outbox); 806 g_ mutex_unlock (priv->todo_lock);806 g_static_rec_mutex_unlock (priv->todo_lock); 807 807 return; 808 808 } … … 822 822 g_object_unref (outbox); 823 823 } 824 g_ mutex_unlock (priv->todo_lock);824 g_static_rec_mutex_unlock (priv->todo_lock); 825 825 826 826 return; … … 965 965 } 966 966 967 g_ mutex_lock (priv->todo_lock);967 g_static_rec_mutex_lock (priv->todo_lock); 968 968 969 969 if (priv->signal != -1) … … 975 975 g_object_unref (priv->outbox_cache); 976 976 977 g_mutex_unlock (priv->todo_lock); 978 979 g_mutex_free (priv->todo_lock); 980 g_mutex_free (priv->sending_lock); 977 g_static_rec_mutex_unlock (priv->todo_lock); 978 979 g_free (priv->todo_lock); 980 priv->todo_lock = NULL; 981 982 g_free (priv->sending_lock); 983 priv->sending_lock = NULL; 984 981 985 g_object_unref (priv->trans_account); 982 986 … … 1142 1146 priv->sentbox_cache = NULL; 1143 1147 priv->outbox_cache = NULL; 1144 priv->todo_lock = g_mutex_new (); 1145 priv->sending_lock = g_mutex_new (); 1148 1149 priv->todo_lock = g_new0 (GStaticRecMutex, 1); 1150 g_static_rec_mutex_init (priv->todo_lock); 1151 priv->sending_lock = g_new0 (GStaticRecMutex, 1); 1152 g_static_rec_mutex_init (priv->sending_lock); 1153 1146 1154 priv->is_running = FALSE; 1147 1155 priv->thread = NULL;
