comparison src/client.c @ 223:ffb1848a39db noffle

[svn] * src/util.c: Improve (correct) error detection when updating timestamp file. * src/content.h, src/content.c: Return Boolean success/fail from Cont_write. Also ensure cont.first isn't polluted in the event of a failed update. * src/client.c,src/control.c,src/fetch.c,src/noffle.c,src/post.c, src/pseudo.c: If Cont_write fails, don't do actions that need it to have worked. Typically, don't update first and last article numbers in group database. * src/server.c: If groupinfo.lastupdate is unreadable or corrupt, spot this and report it and give an explicit error when processing NNTP NEWGROUPS command.
author bears
date Sun, 09 Dec 2001 12:31:57 +0000
parents 7a2b488e258d
children 1ad2602f57db
comparison
equal deleted inserted replaced
222:bf290632d29e 223:ffb1848a39db
1 /* 1 /*
2 client.c 2 client.c
3 3
4 $Id: client.c 334 2001-11-22 15:35:54Z mirkol $ 4 $Id: client.c 342 2001-12-09 12:31:57Z 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
1032 if ( oldLast != Cont_last() ) 1032 if ( oldLast != Cont_last() )
1033 { 1033 {
1034 Log_inf( "Added %s %lu-%lu", client.grp, oldLast + 1, Cont_last() ); 1034 Log_inf( "Added %s %lu-%lu", client.grp, oldLast + 1, Cont_last() );
1035 Log_inf( "%u articles marked for download in %s", 1035 Log_inf( "%u articles marked for download in %s",
1036 cntMarked, client.grp ); 1036 cntMarked, client.grp );
1037 Cont_write(); 1037 if ( Cont_write() )
1038 Grp_setFirstLast( grp, Cont_first(), Cont_last() ); 1038 Grp_setFirstLast( grp, Cont_first(), Cont_last() );
1039 Grp_setLastPostTime( grp ); 1039 Grp_setLastPostTime( grp );
1040 } 1040 }
1041 Lock_closeDatabases(); 1041 Lock_closeDatabases();
1042 del_DynStr( response ); 1042 del_DynStr( response );
1043 del_DynStr( newsgroups ); 1043 del_DynStr( newsgroups );