INN commit: trunk/nnrpd (group.c list.c)
INN Commit
Russ_Allbery at isc.org
Thu Mar 5 20:02:54 UTC 2009
Date: Thursday, March 5, 2009 @ 12:02:54
Author: iulius
Revision: 8374
Fix a bug in the result of LIST ACTIVE, GROUP and LISTGROUP
when the newsgroup is empty.
If n is the common low/high mark, then low=n+1, high=n should
be returned (and not low=n, high=n-1).
Modified:
trunk/nnrpd/group.c
trunk/nnrpd/list.c
---------+
group.c | 8 ++------
list.c | 9 ++++-----
2 files changed, 6 insertions(+), 11 deletions(-)
Modified: group.c
===================================================================
--- group.c 2009-03-05 19:10:33 UTC (rev 8373)
+++ group.c 2009-03-05 20:02:54 UTC (rev 8374)
@@ -115,9 +115,7 @@
/* Doing a GROUP command? */
if (strcasecmp(av[0], "GROUP") == 0) {
if (count == 0) {
- if (ARTlow == 0)
- ARTlow = 1;
- Reply("%d 0 %lu %lu %s\r\n", NNTP_OK_GROUP, ARTlow, ARTlow-1, group);
+ Reply("%d 0 %lu %lu %s\r\n", NNTP_OK_GROUP, ARThigh+1, ARThigh, group);
} else {
/* If we are an NFS reader, check the last nfsreaderdelay
* articles in the group to see if they arrived in the
@@ -194,9 +192,7 @@
}
if (count == 0) {
- if (ARTlow == 0)
- ARTlow = 1;
- Reply("%d 0 %lu %lu %s\r\n", NNTP_OK_GROUP, ARTlow, ARTlow-1, group);
+ Reply("%d 0 %lu %lu %s\r\n", NNTP_OK_GROUP, ARThigh, ARThigh+1, group);
Printf(".\r\n");
} else {
Reply("%d %d %lu %lu %s\r\n", NNTP_OK_GROUP, count, ARTlow,
Modified: list.c
===================================================================
--- list.c 2009-03-05 19:10:33 UTC (rev 8373)
+++ list.c 2009-03-05 20:02:54 UTC (rev 8374)
@@ -148,11 +148,10 @@
/* Convert flags to standardized ones, if possible. */
if (flag == 'j' || flag == 'x')
flag = 'n';
- if (count == 0) {
- if (lo == 0)
- lo = 1;
- hi = lo - 1;
- }
+ /* When a newsgroup is empty, the high water mark should be one less
+ * than the low water mark according to RFC 3977. */
+ if (count == 0)
+ lo = hi + 1;
Reply("%d %s\r\n", NNTP_OK_LIST, INFOactive.Format);
Printf("%s %010u %010u %c\r\n", group, hi, lo, flag);
Printf(".\r\n");
More information about the inn-committers
mailing list