🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #19357

My solution to the large control.cancel directory.

#19357
From: Otmar Lendl
Date: Thu, 17 Jul 1997 00:00
70 lines
2553 bytes

Patch relative to an already hacked inn 1.15.1.

Haven't had time to convert it into a neat INN option + docu yet. :-/


Share and Enjoy !

/ol 


--- /tmp/T0a000ra	Thu Jul 17 16:40:38 1997
+++ art.c	Thu Jul 17 14:11:55 1997
@@ -16,6 +16,9 @@
 extern BOOL DoLinks;
 extern BOOL DoCancels;
 
+#define CANCELGROUPS 100
+#define CANCELGROUPS_STEP 100
+
 #if	defined(S_IXUSR)
 #define EXECUTE_BITS	(S_IXUSR | S_IXGRP | S_IXOTH)
 #else
@@ -1725,6 +1728,9 @@
     static BUFFER	Files;
     static BUFFER	Header;
     static char		buff[SPOOLNAMEBUFF];
+    static int		cancelgroup_index = 0;
+    static int		cancelgroup_step  = 0;
+    static char		cancelgroup_name[8];
     register char	*p;
     register int	i;
     register int	j;
@@ -2054,8 +2060,28 @@
 
     /* Control messages not filed in "to" get filed only in control.name
      * or control. */
-    if (ControlHeader >= 0 && Accepted && !ToGroup) {
-	FileGlue(buff, "control", '.', ControlWord);
+    if (ControlHeader >= 0 && Accepted && !ToGroup) {  
+	/*
+	 * Treat the cancel-messages differently: split them over 
+	 * CANCELGROUPS individual groups control.cancel.cancel-xxx
+	 */
+	if (EQ(ControlWord, "cancel")) {
+	    if (!cancelgroup_step) {	 /* time to step cancelgroup_index ? */
+		cancelgroup_step = CANCELGROUPS_STEP - 1;
+		if (!cancelgroup_index)  
+		    cancelgroup_index = CANCELGROUPS - 1;
+		else
+		    cancelgroup_index--;
+	        sprintf(cancelgroup_name,"%03d",cancelgroup_index);
+	    }
+	    else 
+		cancelgroup_step--;
+	    FileGlue(buff, "control.cancel.cancel", '-', cancelgroup_name);
+	}
+	else {
+	    FileGlue(buff, "control", '.', ControlWord);
+	}
+
 	if ((ngp = NGfind(buff)) == NULL)
 	    ngp = NGfind(ARTctl);
 	ngp->PostCount = 0;
-- 
/ Otmar Lendl (lendl@cosy.sbg.ac.at) # http://www.cosy.sbg.ac.at/~lendl/  \  
\ Killfiles generate SEP fields. Beware: the CE-Norm does not cover them. /

Technical Details
Message-ID: <5qlcfo$pph$1@esel.cosy.sbg.ac.at>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <5qlcfo$pph$1@esel.cosy.sbg.ac.at>
Subject: My solution to the large control.cancel directory.
Date: Thu, 17 Jul 1997 00:00:00 +0000
From: lendl@cosy.sbg.ac.at (Otmar Lendl)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 257432618
Organization: Amalgamated Union of Philosophers, Sages, Luminaries and Other Professional Thinking Persons
Newsgroups: news.software.nntp