# HG changeset patch # User bears # Date 1005735402 0 # Node ID eb2589384836cf421a58a22f58c16b2d2e4c2e33 # Parent a47b47cc1e9d44a7e8f567d96af773f3b99a21a6 [svn] * TODO: Update the TODO list. * src/util.c: When updating timestamp files, write new stamp to temp file and rename, so failure with e.g. full disc doesn't leave an empty stamp file. diff -r a47b47cc1e9d -r eb2589384836 ChangeLog --- a/ChangeLog Sun Nov 11 04:22:42 2001 +0000 +++ b/ChangeLog Wed Nov 14 10:56:42 2001 +0000 @@ -1,3 +1,7 @@ +Tue Nov 6 2001 Jim Hague + +* TODO: Update the TODO list. + Sun Nov 11 2001 Mirko Liß * src.util.c: Minor fix at Utl_parseNewsDate(); fixed SIGSEGV at diff -r a47b47cc1e9d -r eb2589384836 TODO --- a/TODO Sun Nov 11 04:22:42 2001 +0000 +++ b/TODO Wed Nov 14 10:56:42 2001 +0000 @@ -5,9 +5,25 @@ Urgent ------ + * Tidy data structure initialisation when posting (post.c). + + * Post: better checks on posted article (check for duplicate headers, + address in From: headers). + + * Post: Only generate Reply-To: from From: if a configuration option set. + + * Deal properly with headers split over several lines where the overall + content of the header exceeds MAXCHAR characters (i.e. length of Str). + Later ----- + * Provide list of suggested configurations for popular upstream servers. + + * Review latest NNTP draft (http://www.ieft.org/ids.by.wg/nntpext.html). + Noted so far: Implement DATE and OVER. OVER is a synonym for XOVER, + which should continue to work for compatability reasons. + * Improve performance of group database. Using GDBM is a bad choice, better use a btree from the Berkeley db library in libc. This will be a good time for a redesign of the group.h interface @@ -19,8 +35,6 @@ * Implement simple filter using popen or fifos. - * Make compatible to latest NNTP draft. - * Improve speed of online mode: Keep connection to server open for a while * Check all in diff -r a47b47cc1e9d -r eb2589384836 src/util.c --- a/src/util.c Sun Nov 11 04:22:42 2001 +0000 +++ b/src/util.c Wed Nov 14 10:56:42 2001 +0000 @@ -1,7 +1,7 @@ /* util.c - $Id: util.c 321 2001-11-11 03:53:07Z mirkol $ + $Id: util.c 325 2001-11-14 10:56:42Z bears $ */ #if HAVE_CONFIG_H @@ -243,16 +243,31 @@ { FILE *f; time_t t; + Str tmpfname; + snprintf( tmpfname, MAXCHAR, "%s/.#%d.stamp.update", + Cfg_spoolDir(), (int) getpid() ); time( &t ); - if ( ! ( f = fopen( file, "w" ) ) ) + if ( ! ( f = fopen( tmpfname, "w" ) ) ) { Log_err( "Could not open %s for writing (%s)", - file, strerror( errno ) ); + tmpfname, strerror( errno ) ); return; } fprintf( f, "%lu\n", t ); fclose( f ); + if ( ferror( f ) ) + { + Log_err( "Error stamping into file %s: %s", + tmpfname, strerror( errno ) ); + + } + else + { + if ( rename( tmpfname, file ) < 0 ) + Log_err( "Rename of stamp file %s to %s failed: %s", + tmpfname, file, strerror( errno ) ); + } } Bool