aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-data-cache.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace calls to g_string_sprintfa() with g_string_append_printf() sinceJeffrey Stedfast2002-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-12-17 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c: Replace calls to g_string_sprintfa() with g_string_append_printf() since the former seems to have been deprecated. * providers/imap/camel-imap-search.c: Same. * providers/imap/camel-imap-folder.c: Here too. * providers/local/camel-mbox-summary.c: And here. * providers/local/camel-local-summary.c: Replace g_string_sprintf() with g_string_printf(). * camel-data-cache.c (data_cache_expire): Replace g_string_sprintf() with g_string_printf(). * camel-url.c: Replace calls to g_string_sprintfa() with g_string_append_printf() since the former seems to have been deprecated. * camel-service.c: Same. * camel-mime-utils.c: Here too. svn path=/trunk/; revision=19154
* Use a bag instead of a hashtable to track the cache streams.Not Zed2002-12-091-105/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-12-07 Not Zed <NotZed@Ximian.com> * camel-data-cache.c (data_cache_init): Use a bag instead of a hashtable to track the cache streams. (data_cache_finalise): Same. (free_busy): No longer needed. (data_cache_expire): use bag instead of hashtable. (stream_finalised): No longer required. (camel_data_cache_add): objectbagise (camel_data_cache_get): " (camel_data_cache_remove): " (data_cache_path): Set the now expired date before running expiry, so it plays better with multiple threads. Still a couple of harmless races. 2002-12-06 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-store.c (scan_dir): folders -> object bag. (get_folder_info_mbox): folders -> object bag. * providers/local/camel-mh-store.c (folder_info_new): folders -> object bag. * providers/local/camel-maildir-store.c (scan_dir): folders -> object bag. * providers/local/camel-local-store.c (rename_folder): folders -> object bag. * camel-private.h (CamelStorePrivate): Remove 'cache' lock, handled by the objectbag. * providers/imap/camel-imap-store.c (copy_folder): Removed. (imap_store_refresh_folders): folders -> object bag. (get_folder_counts): folders -> object bag. * camel-vee-store.c (vee_get_folder): changes for folders objectbag. (vee_get_folder_info): Change to use folders objectbag. Also, dont refresh the base folder if we're in FAST mode. (build_info): Removed, no longer needed. (vee_rename_folder): Fixed for folders objectbag. * camel-store.c (camel_store_init): init the folders objectbag. (camel_store_finalize): Destroy the folders object bag. (folder_matches): (folder_finalize): Removed, now handled implicitly by the objectbag. (camel_store_get_folder): object bag changes. (camel_store_delete_folder): " (get_subfolders): Removed, now handled without a callback. (camel_store_rename_folder): Changed to use object bag of folders. (trash_add_folder): Removed. (init_trash): use folders object bag. (copy_folder_cache): (sync_folder): Removed, no longer needed. Weird arsed code anyway. (store_sync): Use folder object bag instead of hashtable. (camel_store_unsubscribe_folder): " (camel_store_init): remove cache_lock init, no longer used. (camel_store_finalize): Same for cleanup. 2002-12-05 Not Zed <NotZed@Ximian.com> * camel-store.h (struct _CamelStore): change folders from a hashtable into a CamelObjectBag. * camel-object.c (camel_object_ref): Use type_lock instead of class lock for ref counting. (camel_object_unref): Use type_lock instead of class lock for unref. (camel_object_unref): If the object is 'bagged', then also look hooks, and remove it from any bags. (camel_object_bag_new): (camel_object_bag_destroy): (camel_object_bag_add): (camel_object_bag_get): (camel_object_bag_remove_unlocked): (camel_object_bag_list): (camel_object_bag_abort): (camel_object_bag_remove): New functions to implement a utility object which can manage a 'bag' of weakly ref'd children in an atomic & threadsafe way. svn path=/trunk/; revision=19056
* Use g_strerror when setting an exception string (we need it to be inJeffrey Stedfast2002-11-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-spool-summary.c (spool_summary_sync_full): Use g_strerror when setting an exception string (we need it to be in UTF-8). (spool_summary_check): Here too. * providers/local/camel-spool-store.c (construct): Use g_strerror when setting an exception string (we need it to be in UTF-8). (get_folder): Same. (scan_dir): Here too. * providers/local/camel-spool-folder.c (spool_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-summary.c (mh_summary_check): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-store.c (delete_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mbox-summary.c (summary_update): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_summary_sync_full): Here too. (mbox_summary_sync_quick): Same. (mbox_summary_sync): Also here. (camel_mbox_summary_sync_mbox): Again here. * providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_append_message): Same. (mbox_get_message): Here too. * providers/local/camel-maildir-summary.c (maildir_summary_load): Use g_strerror when setting an exception string (we need it to be in UTF-8). (maildir_summary_check): Same. * providers/local/camel-maildir-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (delete_folder): Same. (delete_folder): Here too. * providers/local/camel-local-summary.c (local_summary_sync): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-local-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (create_folder): Same. (xrename): Here too. (rename_folder): And here. (delete_folder): Also here. * camel-provider.c (camel_provider_init): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-movemail.c (camel_movemail): Use g_strerror when setting an exception string (we need it to be in UTF-8). (movemail_external): Same. (camel_movemail_copy_file): Here too. (camel_movemail_solaris): Also here. * camel-mime-utils.c (rfc2047_decode_word): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (header_encode_param): Same. * camel-mime-part-utils.c (convert_buffer): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-lock-client.c (camel_lock_helper_init): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-data-cache.c (camel_data_cache_remove): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (flaky_tcp_read): Same. * camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-service.c (camel_gethostbyname): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-lock.c (camel_lock_dot): Use g_strerror when setting an exception string (we need it to be in UTF-8). (camel_lock_fcntl): Same. svn path=/trunk/; revision=18689
* Remove the hash table entry using the right path. Related to #29731.Not Zed2002-09-101-2/+2
| | | | | | | | | | 2002-09-10 Not Zed <NotZed@Ximian.com> * camel-data-cache.c (data_cache_expire): Remove the hash table entry using the right path. Related to #29731. (camel_data_cache_remove): " svn path=/trunk/; revision=18031
* If we fail to be able to create a stream to insert into the cache, thenJeffrey Stedfast2002-06-011-0/+2
| | | | | | | | | | 2002-05-31 Jeffrey Stedfast <fejj@ximian.com> * camel-data-cache.c (camel_data_cache_get): If we fail to be able to create a stream to insert into the cache, then free the 'real' path. svn path=/trunk/; revision=17060
* Free the LIST pop3 command.Jeffrey Stedfast2002-04-201-0/+2
| | | | | | | | | | | 2002-04-19 Jeffrey Stedfast <fejj@ximian.com> * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Free the LIST pop3 command. * camel-data-cache.c (data_cache_finalise): Free the cdc->path. svn path=/trunk/; revision=16550
* Added #include <sys/types.h> for dirent.h which needs it on MacOS X.Jeffrey Stedfast2002-04-141-0/+1
| | | | | | | | | | | 2002-04-14 Jeffrey Stedfast <fejj@ximian.com> * camel-provider.c: Added #include <sys/types.h> for dirent.h which needs it on MacOS X. * camel-data-cache.c: Same. svn path=/trunk/; revision=16463
* Changed name from "NT Login" to simply "Login".Not Zed2002-01-301-3/+15
| | | | | | | | | | | | | | | | | | | | | | | 2002-01-30 Not Zed <NotZed@Ximian.com> * camel-sasl-login.c: Changed name from "NT Login" to simply "Login". * providers/pop3/*: Entirely new pop implmentation, supporting pipelining. 2002-01-29 Not Zed <NotZed@Ximian.com> * camel-data-cache.c (free_busy): We dont want to unref the stream, instead, stop listening to the finalised events, and free the path only. 2002-01-25 Not Zed <NotZed@Ximian.com> * camel-data-cache.c (stream_finalised): Remove the object from the busy_stream hashtable, not the busy_path hashtable. svn path=/trunk/; revision=15521
* include stdlib.h (for alloca on freebsd) and only include alloca.h ifChris Toshok2001-12-141-0/+3
| | | | | | | | | 2001-12-13 Chris Toshok <toshok@ximian.com> * camel-data-cache.c: include stdlib.h (for alloca on freebsd) and only include alloca.h if HAVE_ALLOCA_H is defined. svn path=/trunk/; revision=15033
* Completely new implementation of NNTP.Not Zed2001-11-301-0/+476
2001-11-30 Not Zed <NotZed@Ximian.com> * providers/nntp/camel-nntp-*.c: Completely new implementation of NNTP. Doesn't support subscriptions yet (lists all folders), but should be more reliable (faster?), and has an integrated cache. * camel-exception.c (camel_exception_new): Use e_memchunks for exception blocks. (camel_exception_free): Same. * camel-data-cache.[ch]: New object for managing on-disk caches of anything that can be stored in a camel-stream. * camel-file-utils.c (camel_file_util_mkdir): New function, just a nicer place to put this (than camel-store), should be removed from camel-store. (camel_file_util_safe_filename): New function to url-encode a filename. * camel-mime-parser.c (drop_states): New func to drop the parser state to initial state. (folder_scan_init_with_fd): (folder_scan_init_with_stream): Call above func to reset state if the stream is changed on us so we can change streams to reuse a parser object. svn path=/trunk/; revision=14822