comparison 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
comparison
equal deleted inserted replaced
181:e196de757ecd 182:a43a528cfbe7
1 /* 1 /*
2 client.c 2 client.c
3 3
4 $Id: client.c 279 2001-05-09 11:33:43Z bears $ 4 $Id: client.c 286 2001-05-10 16:07:46Z bears $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
687 Client_getNewgrps( const time_t *lastTime ) 687 Client_getNewgrps( const time_t *lastTime )
688 { 688 {
689 Str s; 689 Str s;
690 const char *p; 690 const char *p;
691 DynStr *response; 691 DynStr *response;
692 int stat;
692 693
693 ASSERT( *lastTime > 0 ); 694 ASSERT( *lastTime > 0 );
694 strftime( s, MAXCHAR, "%Y%m%d %H%M00", gmtime( lastTime ) ); 695 strftime( s, MAXCHAR, "%Y%m%d %H%M00", gmtime( lastTime ) );
695 /* 696 /*
696 Do not use century for working with old server software until 2000. 697 Do not use century for working with old server software until 2000.
698 (directly using %y in fmt string causes a Y2K compiler warning) 699 (directly using %y in fmt string causes a Y2K compiler warning)
699 */ 700 */
700 p = s + 2; 701 p = s + 2;
701 if ( ! putCmd( "NEWGROUPS %s GMT", p ) ) 702 if ( ! putCmd( "NEWGROUPS %s GMT", p ) )
702 return FALSE; 703 return FALSE;
703 if ( getStat() != STAT_NEW_GRP_FOLLOW ) 704 stat = getStat();
705 if ( stat != STAT_NEW_GRP_FOLLOW )
704 { 706 {
705 Log_err( "NEWGROUPS command failed: %s", client.lastStat ); 707 Log_err( "NEWGROUPS command failed: %s", client.lastStat );
706 return FALSE; 708
709 /*
710 * If NEWGROUPS fails, it isn't necessarily fatal. You can do
711 * a periodic noffle --query groups to refresh your group list.
712 * So only return failure here if the status indicates the link
713 * itself failed.
714 *
715 * In particular, older versions of NNTPcache have a Y2K bug that
716 * stops NEWGROUPS working.
717 */
718 return ( stat != STAT_PROGRAM_FAULT );
707 } 719 }
708 720
709 response = collectTxt(); 721 response = collectTxt();
710 if ( response == NULL ) 722 if ( response == NULL )
711 return FALSE; 723 return FALSE;