From 7cd517dc60d56c2203d82faffaf40dc5cc7aed5a Mon Sep 17 00:00:00 2001 From: Sam Creasey Date: Tue, 3 Jul 2001 02:54:06 +0000 Subject: Implemented nntp_folder_search_by_expression and nntp_folder_search_free. 2001-07-02 Sam Creasey * providers/nntp/camel-nntp-folder.c: Implemented nntp_folder_search_by_expression and nntp_folder_search_free. Basic search functionality e.g. unread marking now works for NNTP folders. * camel_filter_search.c (get_size): Added get-size sexp directive to get the size of a message for filters. * providers/nntp/camel-nntp-folder.c (camel_nntp_folder_new): Always check with the NNTP server after summary load -- this function now always expires old summary entries and syncs with the news server. * providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers): Only fetch headers for articles not already logged in the summary file. * providers/nntp/camel-nntp-grouplist.c (camel_nntp_get_grouplist_from_*): change from g_list_append() to g_list_prepend() + g_list_reverse. Traversing 40,000 element linked lists sucks. * providers/nntp/camel-nntp-store.c (camel_nntp_command): Should the NNTP connection die with CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, make a single retry attempt. Timing out the NNTP link is less painful this way. svn path=/trunk/; revision=10716 --- camel/providers/nntp/camel-nntp-grouplist.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'camel/providers/nntp/camel-nntp-grouplist.c') diff --git a/camel/providers/nntp/camel-nntp-grouplist.c b/camel/providers/nntp/camel-nntp-grouplist.c index 8969f651b3..e77a28821c 100644 --- a/camel/providers/nntp/camel-nntp-grouplist.c +++ b/camel/providers/nntp/camel-nntp-grouplist.c @@ -52,8 +52,10 @@ camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex) while (!done) { char *line; - if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (store), &line, ex) < 0) + if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (store), &line, ex) < 0) { + list->group_list = g_list_reverse(list->group_list); return list; + } if (*line == '.') { done = TRUE; @@ -68,10 +70,11 @@ camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex) g_strfreev (split_line); - list->group_list = g_list_append (list->group_list, entry); + list->group_list = g_list_prepend (list->group_list, entry); } } + list->group_list = g_list_reverse(list->group_list); return list; } @@ -123,11 +126,12 @@ camel_nntp_get_grouplist_from_file (CamelNNTPStore *store, CamelException *ex) g_strfreev (split_line); - list->group_list = g_list_append (list->group_list, entry); + list->group_list = g_list_prepend (list->group_list, entry); } fclose (fp); + list->group_list = g_list_reverse(list->group_list); return list; } -- cgit v1.2.3