Mercurial > noffle
comparison src/control.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 | 24d4cd032da5 |
children | 01755687c565 |
comparison
equal
deleted
inserted
replaced
222:bf290632d29e | 223:ffb1848a39db |
---|---|
1 /* | 1 /* |
2 control.c | 2 control.c |
3 | 3 |
4 $Id: control.c 316 2001-10-31 11:44:53Z bears $ | 4 $Id: control.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 |
25 ItemList *refs; | 25 ItemList *refs; |
26 const char *ref; | 26 const char *ref; |
27 Str server; | 27 Str server; |
28 Bool seen = FALSE; | 28 Bool seen = FALSE; |
29 int res = CANCEL_OK; | 29 int res = CANCEL_OK; |
30 Bool removeFromDb = TRUE; | |
30 | 31 |
31 /* See if in outgoing and zap if so. */ | 32 /* See if in outgoing and zap if so. */ |
32 if ( Out_find( msgId, server ) ) | 33 if ( Out_find( msgId, server ) ) |
33 { | 34 { |
34 Out_remove( server, msgId ); | 35 Out_remove( server, msgId ); |
58 | 59 |
59 if ( Grp_exists( grp ) ) | 60 if ( Grp_exists( grp ) ) |
60 { | 61 { |
61 Cont_read( grp ); | 62 Cont_read( grp ); |
62 Cont_delete( no ); | 63 Cont_delete( no ); |
63 Cont_write(); | 64 /* |
65 * If we don't manage to remove the overview, leave the message | |
66 * in the main database to avoid confusion. Yes, the message | |
67 * will not be cancelled properly for this group but we don't | |
68 * signal this to the calling routine. | |
69 */ | |
70 if ( Cont_write() ) | |
71 Log_dbg( LOG_DBG_CONTROL, | |
72 "Removed '%s' from group '%s'.", | |
73 msgId, grp ); | |
74 else | |
75 removeFromDb = FALSE; | |
64 | 76 |
65 if ( ! Grp_local( grp ) && ! seen ) | 77 if ( ! Grp_local( grp ) && ! seen ) |
66 res = CANCEL_NEEDS_MSG; | 78 res = CANCEL_NEEDS_MSG; |
67 | |
68 Log_dbg( LOG_DBG_CONTROL, | |
69 "Removed '%s' from group '%s'.", | |
70 msgId, grp ); | |
71 } | 79 } |
72 else | 80 else |
73 { | 81 { |
74 Log_inf( "Group '%s' in Xref for '%s' not found.", grp, msgId ); | 82 Log_inf( "Group '%s' in Xref for '%s' not found.", grp, msgId ); |
75 } | 83 } |
76 } | 84 } |
77 del_Itl( refs ); | 85 del_Itl( refs ); |
78 Db_delete( msgId ); | 86 if ( removeFromDb ) |
87 Db_delete( msgId ); | |
79 Log_inf( "Message '%s' cancelled.", msgId ); | 88 Log_inf( "Message '%s' cancelled.", msgId ); |
80 return res; | 89 return res; |
81 } | 90 } |