Re: [Evolution-hackers] [PATCH] handle "Unimplemented" NNTP DATE responses



FYI i've attached the patch in its final form below.  I changed some of
the exception handling around and avoided a double date-request failure.
This is now committed to head (2.3.x).

Thanks again.
 Michael

On Wed, 2005-04-13 at 19:58 +0200, Alessandro Decina wrote:
> Hello,
> 
> since it is the first time I look at evolution, I am posting this little
> patch here, so that it could be eventually reviewed.
> 
> This small patch fixes the camel nntp provider to handle properly
> newsservers that do not support the DATE command.
> 
> The nntp_get_date function is used to update the date of the last news
> list, to use the NEWGROUPS command to fetch new newsgroups when
> required.
> 
> Some (small) newsservers (such as SN) do not support the DATE command.
> This patch makes the provider download the complete list of newsgroups
> when DATE is unimplemented (the same behaviour already implemented when
> the NEWGROUPS command is unavailable).
> 
Index: camel/providers/nntp/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/ChangeLog,v
retrieving revision 1.1
diff -u -p -r1.1 ChangeLog
--- camel/providers/nntp/ChangeLog	16 Mar 2005 08:42:43 -0000	1.1
+++ camel/providers/nntp/ChangeLog	22 Apr 2005 02:57:11 -0000
@@ -1,3 +1,13 @@
+2005-04-22  Not Zed  <NotZed Ximian com>
+
+	* camel-nntp-store.c (nntp_store_get_folder_info_all): don't set
+	exceptions for failed date commands from last patch.
+
+2005-04-22  Alessandro Decina <alessandro nnva org>
+
+	* camel-nntp-store.c (nntp_store_get_folder_info_all): If we fail
+	to get the date, just abort.
+
 2005-03-16  Not Zed  <NotZed Ximian com>
 
 	* modified patch below to make it a bit simpler.
Index: camel/providers/nntp/camel-nntp-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/camel-nntp-store.c,v
retrieving revision 1.78
diff -u -p -r1.78 camel-nntp-store.c
--- camel/providers/nntp/camel-nntp-store.c	16 Mar 2005 08:42:43 -0000	1.78
+++ camel/providers/nntp/camel-nntp-store.c	22 Apr 2005 02:57:12 -0000
@@ -779,9 +779,10 @@ nntp_store_get_folder_info_all(CamelNNTP
 			date[6] = ' ';
 			memcpy(date + 7, summary->last_newslist + 8, 6); /* HHMMSS */
 			date[13] = '\0';
-			
-			if (!nntp_get_date (nntp_store, ex))
-				goto error;
+
+			/* Some servers don't support date (!), so fallback if they dont */
+			if (!nntp_get_date (nntp_store, NULL))
+				goto do_complete_list_nodate;
 			
 			ret = camel_nntp_command (nntp_store, ex, NULL, (char **) &line, "newgroups %s", date);
 			if (ret == -1)
@@ -801,9 +802,8 @@ nntp_store_get_folder_info_all(CamelNNTP
 		do_complete_list:
 			/* seems we do need a complete list */
 			/* at first, we do a DATE to find out the last load occasion */
-			if (!nntp_get_date (nntp_store, ex))
-				goto error;
-			
+			nntp_get_date (nntp_store, NULL);
+		do_complete_list_nodate:
 			ret = camel_nntp_command (nntp_store, ex, NULL, (char **)&line, "list");
 			if (ret == -1)
 				goto error;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]