Fixed reset LR pointers in empty message areas.

This commit is contained in:
Michiel Broek 2004-07-08 19:33:00 +00:00
parent 053182b875
commit 8b152e4960
3 changed files with 12 additions and 8 deletions

View File

@ -13,6 +13,10 @@ v0.61.1 20-Jun-2004.
used then mbfido behaves like it did upto version 0.50.0 and used then mbfido behaves like it did upto version 0.50.0 and
mbnntp is disabled. mbnntp is disabled.
libmsgbase.a:
If a message area becomes empty after a pack, all lastread
pointers are reset to zero.
mbfido: mbfido:
Added compile directive for full newsgate. Added compile directive for full newsgate.

6
TODO
View File

@ -29,12 +29,6 @@ libdiesel.a:
U: Processed stringlines containing unbalanced " characters are not U: Processed stringlines containing unbalanced " characters are not
processed, instead the previous macro value will be returned. processed, instead the previous macro value will be returned.
libmsgbase.a:
N: If a area becomes empty, the lastread pointers have the wrong value
the should be zero so that when a new (first) message arrives in the
area, mbsebbs, GoldED etc will show that there are new unread
messages in the area.
mbsebbs: mbsebbs:
U: If a users homedir is missing, the users sees a wrong error message U: If a users homedir is missing, the users sees a wrong error message
before the connection is terminated. before the connection is terminated.

View File

@ -709,12 +709,18 @@ void JAM_Pack(void)
} }
/* /*
* Now copy the lastread file * Now copy the lastread file, reset LastRead pointers if area is empty.
*/ */
lseek(fdJlr, 0, SEEK_SET); lseek(fdJlr, 0, SEEK_SET);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (read(fdJlr, &LR, sizeof(lastread)) == sizeof(lastread)) if (read(fdJlr, &LR, sizeof(lastread)) == sizeof(lastread)) {
if (jamHdrInfo.ActiveMsgs == 0 && (LR.LastReadMsg || LR.HighReadMsg)) {
Syslog('-', "jamPack: reset LR pointer index %d, area %s", i, BaseName);
LR.LastReadMsg = 0;
LR.HighReadMsg = 0;
}
write(fdnJlr, &LR, sizeof(lastread)); write(fdnJlr, &LR, sizeof(lastread));
}
} }
/* /*