INN commit: trunk/nnrpd (list.c)

INN Commit Russ_Allbery at isc.org
Thu Mar 5 19:00:43 UTC 2009


    Date: Thursday, March 5, 2009 @ 11:00:43
  Author: iulius
Revision: 8372

When a newsgroup is empty, the high water mark should be one less
than the low water mark according to RFC 3977.
Fix LIST ACTIVE to do that when possible.

Modified:
  trunk/nnrpd/list.c

--------+
 list.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Modified: list.c
===================================================================
--- list.c	2009-03-01 19:15:23 UTC (rev 8371)
+++ list.c	2009-03-05 19:00:43 UTC (rev 8372)
@@ -137,17 +137,22 @@
 CMD_list_single(char *group)
 {
     char *grplist[2] = { NULL, NULL };
-    int lo, hi, flag;
+    int lo, hi, count, flag;
 
     if (PERMspecified) {
         grplist[0] = group;
         if (!PERMmatch(PERMreadlist, grplist))
             return false;
     }
-    if (OVgroupstats(group, &lo, &hi, NULL, &flag) && flag != '=') {
+    if (OVgroupstats(group, &lo, &hi, &count, &flag) && flag != '=') {
         /* 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;
+        }
         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