🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #42198

Getting slrn to use LIST ACTIVE instead of GROUP?

#42198
From: Reality is a point of view
Date: Sun, 19 Jul 1998 00:00
62 lines
2560 bytes
While using a new news server, one that carries a large number
of articles (10,000+ for some groups), I noticed slrn starting
up very slowly.  Too slow.  After finding out that GROUP was
causing the problem I was told LIST ACTIVE is faster.  So,
after a night out, I foolishly tried to munge.  Broken patch
follows.  NNTP_Type reuse bug?  estim = bug?  slrn_opn_xover()
side effect?  I'm going to bed, you tell me.

-- 
Gary Johnson     gjohnson@season.com
Privacy on the net is still illegal.


--- nntplib.orig	Sun May  3 13:06:26 1998
+++ nntplib.c	Sun Jul 19 04:56:55 1998
@@ -199,6 +199,24 @@
    if (-1 == nntp_gets_server (s, s->rspbuf, NNTP_RSPBUF_SIZE))
      return -1;
 
+/*
+This is an hack that fakes multiline response parsing for the
+LIST ACTIVE special case.  I know nothing about NNTP_Type state
+changes, I just want faster GROUP data.
+*/
+	if( strstr( s->rspbuf, "list:" ) != NULL )
+	{
+		NNTP_Type cheese = *s;
+		char curd[NNTP_RSPBUF_SIZE];
+		if( -1 == nntp_gets_server( &cheese, cheese.rspbuf, NNTP_RSPBUF_SIZE ) )
+			return 1;
+		strcpy( curd, cheese.rspbuf );
+		if( -1 == nntp_gets_server( &cheese, cheese.rspbuf, NNTP_RSPBUF_SIZE ) )
+			return 1;
+		strcpy( s->rspbuf, "211 " );
+		strcat( s->rspbuf, curd );
+	}
+
    status = atoi (s->rspbuf);
 
    if (((status == ERR_FAULT) && (-1 != _nntp_try_parse_timeout (s->rspbuf)))
@@ -701,16 +719,17 @@
    int estim;
    int min, max;
 
-   switch (nntp_server_vcmd (s, "GROUP %s", name))
+   switch (nntp_server_vcmd (s, "LIST ACTIVE %s", name))
      {
       case -1:
 	return -1;
 
       case OK_GROUP:
 
-	if (3 != sscanf(s->rspbuf + 4, "%d %d %d", &estim, &min, &max))
+	if (2 != sscanf(s->rspbuf + strlen( name ) + 1 + 4, "%d %d", &max, &min))
 	  return -1;
 
+	estim = max - min;
 	if (minp != NULL) *minp = min;
 	if (maxp != NULL) *maxp = max;
 

Technical Details
Message-ID: <slrn6r3vn3.7tk.gjohnson@dream.season.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrn6r3vn3.7tk.gjohnson@dream.season.com>
Subject: Getting slrn to use LIST ACTIVE instead of GROUP?
Date: Sun, 19 Jul 1998 00:00:00 +0000
From: gjohnson@dream.season.com (Reality is a point of view)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 372878623
X-Complaints-To: newsabuse@supernews.com
X-Trace: 900857718 MPCBFHUBS212ACDB3C usenet53.supernews.com
Organization: season.com [205.179.33.0]
Newsgroups: news.software.readers