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-store.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'camel/providers/nntp/camel-nntp-store.c') diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index e4e115cea4..d72db9b6b3 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -298,7 +298,7 @@ static CamelServiceAuthType password_authtype = { }; static GList * -nntp_store_query_auth_types (CamelService *service, gboolean connect, CamelException *ex) +nntp_store_query_auth_types (CamelService *service, CamelException *ex) { GList *prev; @@ -313,8 +313,6 @@ nntp_store_get_folder (CamelStore *store, const gchar *folder_name, { CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store); - printf ("get_folder called on folder_name=%s\n", folder_name); - /* if we haven't already read our .newsrc, read it now */ if (!nntp_store->newsrc) nntp_store->newsrc = @@ -468,8 +466,7 @@ build_folder_info_from_grouplist (CamelNNTPStore *nntp_store, const char *top) static CamelFolderInfo * nntp_store_get_folder_info (CamelStore *store, const char *top, - gboolean fast, gboolean recursive, - gboolean subscribed_only, + guint32 flags, CamelException *ex) { CamelURL *url = CAMEL_SERVICE (store)->url; @@ -491,7 +488,7 @@ nntp_store_get_folder_info (CamelStore *store, const char *top, return NULL; } - if (!subscribed_only) { + if (!(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)) { if (!nntp_store->group_list) nntp_store->group_list = camel_nntp_grouplist_fetch (nntp_store, ex); if (camel_exception_is_set (ex)) { @@ -716,6 +713,16 @@ camel_nntp_command (CamelNNTPStore *store, CamelException *ex, char **ret, char resp_code = camel_nntp_command_send_recv (store, ex, ret, cmdbuf); + if(camel_exception_get_id(ex) == + CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED) { + /* the connect might have timed out, give it another shot.. */ + camel_exception_clear(ex); + if(nntp_store_connect(CAMEL_SERVICE(store), ex)) + resp_code = + camel_nntp_command_send_recv (store, ex, ret, cmdbuf); + /* that's it, no more tries */ + } + g_free (cmdbuf); return resp_code; -- cgit v1.2.3