aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-data-cache.c
Commit message (Collapse)AuthorAgeFilesLines
* Kill dead filesJP Rosevear2005-01-111-427/+0
| | | | svn path=/trunk/; revision=28342
* Merged notzed-eplugin-2-branch to head.Michael Zucci2004-09-201-0/+1
| | | | svn path=/trunk/; revision=27300
* ** See bug #52996.Not Zed2004-01-211-6/+11
| | | | | | | | | | | | | | | | | | | | | | 2004-01-21 Not Zed <NotZed@Ximian.com> ** See bug #52996. * camel-data-cache.c (camel_data_cache_add): put a do-loop around the object_bag_reserve stuff, otherwise we can add/abort out of sync (i.e. when object_bag_reserve returned a pointer we mustn't call add/abort). * camel-object.c (camel_object_bag_*): Added some inline doco. ~ ~ ~ ~ ~ ~ svn path=/trunk/; revision=24339
* Use camel_mkdir().Jeffrey Stedfast2003-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-07-07 Jeffrey Stedfast <fejj@ximian.com> * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new): Use camel_mkdir(). * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Use camel_mkdir(). * camel-session.c (get_storage_path): Use camel_mkdir(). * camel-store.c (camel_mkdir_hier): Removed. * camel-data-cache.c (camel_data_cache_new): Updated to use camel_mkdir(). (data_cache_path): Same. * camel-file-utils.c (camel_mkdir): Renamed and documented. (camel_file_util_safe_filename): Documented. (camel_read): Moved here from camel-io.c (camel_write): Same. * camel-io.[c,h]: Removed. * camel-uid-cache.c (camel_uid_cache_new): Use the camel-file-utils.c version of mkdir. svn path=/trunk/; revision=21753
* Ensure cmdbuf is initialized to avoid compiler warning.Jeremy Katz2003-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-05-16 Jeremy Katz <katzj@redhat.com> * providers/smtp/camel-smtp-transport.c (smtp_helo): Ensure cmdbuf is initialized to avoid compiler warning. * providers/local/camel-mbox-summary.c (summary_header_load): Cast folder_size to uint32 to fix warning. (camel_mbox_summary_sync_mbox): Update for new API. * providers/imap/camel-imap-utils.c (parse_params): imap_parse_nstring expects size_t, not int (imap_body_decode): Likewise. * camel-stream-filter.c (do_read): presize needs to be size_t instead of int. (do_write): Likewise. * camel-seekable-substream.c (stream_read): Return ssize_t instead of int to match prototypes. (stream_write): Likewise. * camel-mime-part.c (construct_from_parser): len needs to be size_t instead of int. * camel-mime-parser.c (folder_scan_step): datalength needs to be a size_t* instead of an int* to make dependent APIs safe. (camel_mime_parser_step): Likewise. (folder_scan_content): Likewise. * camel-mime-parser.h: Likewise. * camel-mime-message.c (camel_mime_message_class_init): Use glib macro for pointer/int conversions. (construct_from_parser): Update for new API. * camel-folder-summary.c (camel_folder_summary_info_new_from_parser): Update len to be size_t for new API. (summary_build_content_info): Likewise. * camel-http-stream.c (http_get_headers): Likewise. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Likewise. * camel-multipart-signed.c (signed_construct_from_parser): Likewise. * camel-multipart.c (construct_from_parser): Likewise. * camel-folder-search.c (match_words_index): Use glib macros for pointer/int conversions. * camel-html-parser.c (tokenise_setup): Likewise. (convert_entity): Likewise. * camel-block-file.c (block_hash_func): Likewise. (camel_block_file_get_block): Likewise. (camel_block_file_get_block): Likewise. (camel_block_file_detach_block): Likewise. * camel-session.c (session_thread_msg_new): Likewise. (session_thread_msg_free): Likewise. (session_thread_wait): Likewise. * camel-text-index.c (text_index_compress_nosync): Likewise. (text_index_compress_nosync): Likewise. (camel_text_index_validate): Likewise. * camel-vee-folder.c (vee_folder_remove_folder): Likewise. (unmatched_check_uid): Likewise. (folder_added_uid): Likewise. (vee_folder_build_folder): Likewise. (folder_changed_add_uid): Likewise. (folder_changed_remove_uid): Likewise. * providers/imap/camel-imap-search.c (imap_body_contains): Likewise. * providers/pop3/camel-pop3-folder.c (cmd_list): Likewise. (cmd_uidl): Likewise. * camel-data-cache.c (data_cache_init): Cast to CamelCopyFunc. Fixes a warning. svn path=/trunk/; revision=21220
* ** Should fix #41629, #41448, et al.Not Zed2003-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-04-22 Not Zed <NotZed@Ximian.com> ** Should fix #41629, #41448, et al. * tests/folder/test10.c: a new torture test for object bag creation/unreffing. * camel-url.c (camel_url_copy): new function to copy a url. * camel-object.c (camel_object_bag_new): add arguments for key copy and key free functions. Fixed all callers. (camel_object_bag_destroy): fix a memleak, free the bag key. (camel_object_bag_get, camel_object_bag_reserve) (camel_object_bag_abort, save_bag, save_object): Make the key a void type, rather than char *. (camel_object_bag_add): As above, and also copy the key. (camel_object_bag_remove_unlocked): free the key using bag->free_key. * camel-session.c (register_provider) (camel_session_destroy_provider, get_service): Changed to use an object bag instead of a hash table for the service 'cache'. (service_cache_remove): Removed, no longer required. svn path=/trunk/; revision=20930
* remove unused var.Not Zed2003-03-281-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-03-28 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-store.c (get_folder): remove unused var. * providers/imap/camel-imap-utils.c (imap_parse_list_response): moved an unused var to the #if 0'd out block. * providers/imap/camel-imap-store.c (parse_list_response_as_folder_info): remove unused vars. * camel-index-control.c (main): deifne camel_init() before using it. * camel-vee-store.c (vee_get_folder): removed unused var. * camel-stream-mem.c (stream_write): warning -> fixme. * camel-stream-filter.c (_CamelStreamFilterPrivate): Add a ; to the end of the struct definition. * camel-store.c (camel_store_delete_folder): remove unused var. (camel_store_rename_folder): " (camel_store_unsubscribe_folder): " * camel-mime-part.c (write_to_stream): Changed warning into a TODO. (construct_from_parser): removed warning, the code was fixed. * camel-mime-message.c (construct_from_parser): Remove the warning, the code was fixed. * camel-mime-filter-enriched.c (camel_mime_filter_enriched_new): Remove unused var. * camel-medium.c (camel_medium_get_header): Removed warning, and changed docs to reflect it. * camel-gpg-context.c (gpg_ctx_parse_status): handle MODE_EXPORT as a noop (warning). * camel-folder.c (get_message_user_tag): changed a warning into a fixme (its not that important). (camel_folder_get_message_user_tag): " * camel-data-cache.c (data_cache_finalise): removed unused vars. (data_cache_expire): " svn path=/trunk/; revision=20556
* 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