[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] No Pseudo Article



* Jeff Grossman wrote on Mon, Jul 22, 2002 at 12:24:49AM CEST:
[ leafnode-2 snapshot, no pseudo article on never-visited group ]
> Okay, here you go:
*snip log*
> Jul 21 15:19:11 apple leafnode[11541]: >211 0 1 1 comp.dcom.sys.nortel
> group selected
> Jul 21 15:19:26 apple leafnode[11541]: <GROUP comp.dcom.sys.wellfleet
> Jul 21 15:19:26 apple leafnode[11541]: >211 0 1 1
*snip log*
> The two groups I tried to subscribe to, I have never subscribed to
> before.  But, I do not get the pseudo article.  If I try doing the same
> with Tin, it works fine.

Thanks a lot.  I see the problem, a real fix involves more than one
place and I'm pretty short of time at the moment to do lengthy tests.
Thus, the patch below isn't a real fix for the whole problem with pseudo
articles, but it should work on never-visited groups (problems remain
for now-empty groups that were read once).  I'll promise a real fix
before that happens to anyone (starting out with this snapshot).

To apply, save this mail, enter the leafnode source/directory and
  patch -p1 </path/to/this/mail

Regards,
Ralf

Index: getwatermarks.c
===================================================================
RCS file: /home/ralf/download/CVSup/test/rep/leafnode-2/getwatermarks.c,v
retrieving revision 1.3
diff -u -r1.3 getwatermarks.c
--- getwatermarks.c	3 Jul 2002 20:50:17 -0000	1.3
+++ getwatermarks.c	22 Jul 2002 15:45:45 -0000
@@ -53,7 +53,8 @@
     if (closedir(ng) != 0) {
 	return -1;
     }
-    *f = first;
+    if (first > 0)
+	*f = first;
     if (last > *l)
 	*l = last;
     if (c) {
Index: nntpd.c
===================================================================
RCS file: /home/ralf/download/CVSup/test/rep/leafnode-2/nntpd.c,v
retrieving revision 1.97
diff -u -r1.97 nntpd.c
--- nntpd.c	16 Jul 2002 08:25:45 -0000	1.97
+++ nntpd.c	22 Jul 2002 15:39:16 -0000
@@ -779,6 +779,7 @@
 dogroup(struct newsgroup *group, const char *arg, unsigned long *artno)
 {
     struct newsgroup *g;
+    unsigned long count;
 
     rereadactive();
     g = findgroup(arg, active, -1);
@@ -799,8 +800,13 @@
 	    }
 	}
 
+	if (g->count == 0 && g->first == 1)
+	    count = 1;
+	else
+	    count = g->count;
+
 	nntpprintf("211 %lu %lu %lu %s group selected",
-		   g->count, g->first, g->last, g->name);
+		   count, g->first, g->last, g->name);
 	*artno = g->first;
 
 	fflush(stdout);

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list