diff src/client.c @ 182:a43a528cfbe7 noffle

[svn] * src/client.c: Only return failure getting NEWGROUPS if the connection failed. If the server doesn't implement NEWGROUPS correctly (step forward elderly versions of NNTPcache) it isn't fatal to the fetch process. You can still do a 'noffle --query groups' to update your newsgroup list.
author bears
date Thu, 10 May 2001 17:07:46 +0100
parents 09ca6eb5c7ff
children c912e8288164
line wrap: on
line diff
--- a/src/client.c	Thu May 10 17:00:12 2001 +0100
+++ b/src/client.c	Thu May 10 17:07:46 2001 +0100
@@ -1,7 +1,7 @@
 /*
   client.c
 
-  $Id: client.c 279 2001-05-09 11:33:43Z bears $
+  $Id: client.c 286 2001-05-10 16:07:46Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -689,6 +689,7 @@
     Str s;
     const char *p;
     DynStr *response;
+    int stat;
 
     ASSERT( *lastTime > 0 );
     strftime( s, MAXCHAR, "%Y%m%d %H%M00", gmtime( lastTime ) );
@@ -700,10 +701,21 @@
     p = s + 2;
     if ( ! putCmd( "NEWGROUPS %s GMT", p ) )
         return FALSE;
-    if ( getStat() != STAT_NEW_GRP_FOLLOW )
+    stat = getStat();
+    if ( stat != STAT_NEW_GRP_FOLLOW )
     {
         Log_err( "NEWGROUPS command failed: %s", client.lastStat );
-        return FALSE;
+
+	/*
+	 * If NEWGROUPS fails, it isn't necessarily fatal. You can do
+	 * a periodic noffle --query groups to refresh your group list.
+	 * So only return failure here if the status indicates the link
+	 * itself failed.
+	 *
+	 * In particular, older versions of NNTPcache have a Y2K bug that
+	 * stops NEWGROUPS working.
+	 */
+        return ( stat != STAT_PROGRAM_FAULT );
     }
 
     response = collectTxt();