Changeset 1843
- Timestamp:
- 04/27/07 12:04:00
- Files:
-
- trunk/ChangeLog (modified) (6 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (5 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1842 r1843 1 2007-04-27 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Creating a new connection for getting uncached messages 4 with the IMAP code. 5 1 6 2007-04-27 Murray Cumming <murrayc@murrayc.com> 2 7 3 8 * libtinymail-maemo/tny-maemo-conic-device.c: 4 (on_connection_event), (tny_maemo_conic_device_get_iap): Added some comments and 5 improved the (temporary) debug output so its more obvious what is happening. 9 (on_connection_event), (tny_maemo_conic_device_get_iap): Added some 10 comments and improved the (temporary) debug output so its more 11 obvious what is happening. 6 12 7 13 * libtinymail/tny-device.c: Correct the tny_device_force_offline() and … … 13 19 * libtinymail-maemo/tny-maemo-conic-device.c: 14 20 (tny_maemo_conic_device_instance_init), 15 (tny_maemo_conic_device_new): Do all the initialization in init, because16 _new functions should just call g_object_new() and not access private API,17 because they are just C convenience functions.21 (tny_maemo_conic_device_new): Do all the initialization in init, 22 because _new functions should just call g_object_new() and not 23 access private API, because they are just C convenience functions. 18 24 (on_connection_event), (tny_maemo_conic_device_connect), 19 25 (tny_maemo_conic_device_disconnect), … … 23 29 (tny_maemo_conic_device_force_offline), 24 30 (tny_maemo_conic_device_finalize): 25 Copy the iap string instead of just storing the pointer, because we have no 26 guarantees about the lifetime of the string that con_ic_event_get_iap_id() 27 returns. Free it in finalize. 28 Added g_return_if*() checks for priv->cnx, without which nothing could work. 31 Copy the iap string instead of just storing the pointer, because 32 we have no guarantees about the lifetime of the string that 33 con_ic_event_get_iap_id() returns. Free it in finalize. 34 Added g_return_if*() checks for priv->cnx, without which nothing 35 could work. 29 36 30 37 2007-04-23 Philip Van Hoof <pvanhoof@gnome.org> … … 51 58 2007-04-23 Javier Fernandez Garcia-Boente 52 59 53 * Change priority flags management, using a bit mask to get assigned priority. 60 * Change priority flags management, using a bit mask to get assigned 61 priority. 54 62 * New enumeration to define available priority flags. 55 63 … … 99 107 Take a TnyMaemoConicDevice* instead of a TnyDevice, as that is 100 108 the convention for derived/implemented objects. 101 Correct the TNY_TYPE_MAEMO_CONIC_DEVICE implementation so that this can be used. 109 Correct the TNY_TYPE_MAEMO_CONIC_DEVICE implementation so that 110 this can be used. 102 111 103 112 2007-04-17 Shilpa Musti <Shilpa.Musti@nokia.com> … … 179 188 * This ain't an API change, but this new feature does make more 180 189 possible with the same API. It might also change behaviour a little 181 bit (although it shouldn't for the old-style of using the TnyFolderMonitor,182 or at least not as far as I know and tested).190 bit (although it shouldn't for the old-style of using the 191 TnyFolderMonitor, or at least not as far as I know and tested). 183 192 184 193 2007-03-23 Philip Van Hoof <pvanhoof@gnome.org> trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c
r1809 r1843 271 271 store->command++, cmd); 272 272 len = strlen (full_cmd); 273 274 /* printf ("-> %s\n", full_cmd); */ 273 275 274 276 nwritten = camel_stream_write (store->ostream, full_cmd, len); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r1809 r1843 3831 3831 { 3832 3832 CamelFolder *folder = CAMEL_FOLDER (imap_folder); 3833 CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);3833 CamelImapStore *store = NULL; 3834 3834 CamelStream *stream = NULL; 3835 3835 gboolean connected = FALSE, idle_rt = FALSE; 3836 CamelException tex = CAMEL_EXCEPTION_INITIALISER, myex = CAMEL_EXCEPTION_INITIALISER; 3837 ssize_t nread = 0; 3836 CamelException tex = CAMEL_EXCEPTION_INITIALISER, 3837 myex = CAMEL_EXCEPTION_INITIALISER, 3838 cex = CAMEL_EXCEPTION_INITIALISER; 3839 ssize_t nread = 0; gboolean amcon = FALSE; 3838 3840 gchar *a_resp = NULL; 3839 3841 3840 /* EXPUNGE responses have to modify the cache, which means3841 * they have to grab the cache_lock while holding the3842 * connect_lock.3843 3844 * Because getting the service lock may cause MUCH unecessary3845 * delay when we already have the data locally, we do the3846 * locking separately. This could cause a race3847 * getting the same data from the cache, but that is only3848 * an inefficiency, and bad luck. */3849 3850 3842 CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock); 3851 3843 3852 connected = camel_disco_store_check_online((CamelDiscoStore *)store, &tex); 3853 3854 if (!store->istream || ((CamelObject *)store->istream)->ref_count <= 0) 3855 connected = FALSE; 3856 if (!store->ostream || ((CamelObject *)store->ostream)->ref_count <= 0) 3857 connected = FALSE; 3858 3844 connected = camel_disco_store_check_online(CAMEL_DISCO_STORE (folder->parent_store), &tex); 3845 3859 3846 if (connected && ((type & CAMEL_FOLDER_RECEIVE_FULL) && camel_imap_message_cache_is_partial (imap_folder->cache, uid))) 3860 3847 camel_imap_message_cache_remove (imap_folder->cache, uid); … … 3864 3851 else 3865 3852 { 3866 stream = camel_imap_message_cache_get (imap_folder->cache, uid, section_text, ex); 3867 3868 if (!stream && (!strcmp (section_text, "HEADER") || !strcmp (section_text, "0"))) 3869 { 3870 camel_exception_clear (ex); 3871 stream = camel_imap_message_cache_get (imap_folder->cache, uid, "", ex); 3872 } 3853 stream = camel_imap_message_cache_get (imap_folder->cache, uid, section_text, ex); 3854 if (!stream && (!strcmp (section_text, "HEADER") || !strcmp (section_text, "0"))) 3855 { 3856 camel_exception_clear (ex); 3857 stream = camel_imap_message_cache_get (imap_folder->cache, uid, "", ex); 3858 } 3873 3859 } 3874 3860 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 3875 3861 3876 3862 if (stream || cache_only) 3877 3863 return stream; 3878 3864 3879 if (!camel_disco_store_check_online ((CamelDiscoStore*)store, ex)) { 3865 if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex)) 3866 { 3880 3867 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 3881 3868 _("This message is not currently available")); … … 3885 3872 camel_exception_clear (ex); 3886 3873 3887 CAMEL_SERVICE_REC_LOCK(store, connect_lock); 3888 3889 camel_exception_clear(ex); 3874 store = CAMEL_IMAP_STORE (camel_object_new (CAMEL_IMAP_STORE_TYPE)); 3875 3876 camel_service_construct (CAMEL_SERVICE (store), 3877 camel_service_get_session (CAMEL_SERVICE (folder->parent_store)), 3878 camel_service_get_provider (CAMEL_SERVICE (folder->parent_store)), 3879 CAMEL_SERVICE (folder->parent_store)->url, ex); 3880 3881 if (camel_exception_is_set (ex)) 3882 { 3883 g_critical ("Severe interal error while trying to construct a new connection\n"); 3884 camel_object_unref (store); 3885 return NULL; 3886 } 3887 3888 /* amcon = camel_imap_service_connect (CAMEL_SERVICE (store), ex); */ 3889 amcon = camel_service_connect (CAMEL_SERVICE (store), ex); 3890 3891 if (!amcon || camel_exception_is_set (ex) || !camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex)) 3892 { 3893 camel_object_unref (store); 3894 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 3895 _("This message is not currently available" 3896 " (can't let a new connection go online)")); 3897 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 3898 return NULL; 3899 } 3900 camel_exception_clear (ex); 3901 3902 CAMEL_SERVICE_REC_LOCK(store, connect_lock); 3890 3903 3891 3904 CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock); … … 4252 4265 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 4253 4266 4254 CAMEL_SERVICE_REC_UNLOCK(store, connect_lock); 4267 CAMEL_SERVICE_REC_UNLOCK(store, connect_lock); 4268 4269 camel_service_disconnect (CAMEL_SERVICE (store), TRUE, NULL); 4270 camel_object_unref (CAMEL_OBJECT (store)); 4255 4271 4256 4272 return stream; … … 4272 4288 camel_object_unref (CAMEL_OBJECT (stream)); 4273 4289 4290 if (store) 4291 { 4292 4274 4293 CAMEL_SERVICE_REC_UNLOCK(store, connect_lock); 4275 4294 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 4295 camel_object_unref (CAMEL_OBJECT (store)); 4296 } 4276 4297 return NULL; 4277 4298 } trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r1809 r1843 374 374 } 375 375 } 376 377 376 378 377 379 static int … … 1061 1063 }; 1062 1064 1063 gboolean 1065 1066 static gboolean 1064 1067 connect_to_server_wrapper (CamelService *service, CamelException *ex) 1065 1068 { … … 1113 1116 1114 1117 return ret; 1118 } 1119 1120 gboolean 1121 camel_imap_service_connect (CamelService *service, CamelException *ex) 1122 { 1123 return connect_to_server_wrapper (service, ex); 1115 1124 } 1116 1125 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h
r1740 r1843 160 160 ssize_t camel_imap_store_readline_nb (CamelImapStore *store, char **dest, CamelException *ex); 161 161 ssize_t camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex); 162 gboolean c onnect_to_server_wrapper(CamelService *service, CamelException *ex);162 gboolean camel_imap_service_connect (CamelService *service, CamelException *ex); 163 163 164 164 gboolean camel_imap_store_restore_stream_buffer (CamelImapStore *store);
