🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #3681

INN1.4 spooling Patch

#3681
From: news
Date: Tue, 27 Jun 1995 00:00
117 lines
4105 bytes
1) The function of the "S" flag has been changed.  When a sites buffer
gets to the value specified by the "S" flag, inn will dump the buffer to
disk and then continue on.

2) We made no changes to man pages to reflect this, we just hacked the code.

3) Rich Salz mentioned that this should be a different flag instead of
hacking the S flag.  He is probably right, but I'm not sure as I think
this is what the S flag should have done all along.  Thoughts?

We have tested this pretty well and feel its pretty solid, but please let
me know if we did something stupid (it would be the first time! ) :-)


Anyway, here it is (its also on
ftp.sprintlink.net://networking/news/inn/innd.spool.patch).  This diff
was made against David Barr's <barr@math.psu.edu> unoff1 release of inn so
its slightly different than stock inn1.4.

*** site.c.orig Fri Jun 23 09:42:48 1995
--- site.c      Thu Jun 22 16:15:15 1995
***************
*** 150,156 ****
--- 150,200 ----
      SITEcount--;
  }

+ /*
+  * *  Bilge Site's Channel out buffer.
+  */
+ STATIC          BOOL
+ SITECHANbilge(sp)
+     register SITE  *sp;
+ {
+     int             fd, i;
+     char            buff[SPOOLNAMEBUFF];
+     char           *name;

+     name = sp->SpoolName;
+     fd = open(name, O_APPEND | O_CREAT | O_WRONLY, BATCHFILE_MODE);
+     if (fd < 0 && errno == EISDIR) {
+         FileGlue(buff, sp->SpoolName, '/', "togo");
+         name = buff;
+         fd = open(buff, O_APPEND | O_CREAT | O_WRONLY, BATCHFILE_MODE);
+     }
+     if (fd < 0) {
+         IOError("site batch file");
+         syslog(L_ERROR, "%s cant open %s %m", sp->Name, name);
+         sp->Channel = NULL;
+         return FALSE;
+     }
+     while(sp->Channel->Out.Left > 0) {
+         i = write(fd, (POINTER)
&sp->Channel->Out.Data[sp->Channel->Out.Used],
+             (SIZE_T) sp->Channel->Out.Left);
+         if(i <= 0) {
+             syslog(L_ERROR,"%s cant spool count %d",CHANname(sp->Channel),
+                 sp->Channel->Out.Left);
+             close(fd);
+             return FALSE;
+         }
+         sp->Channel->Out.Left -= i;
+         sp->Channel->Out.Used += i;
+     }
+     close(fd);
+     DISPOSE(sp->Channel->Out.Data);
+     sp->Channel->Out.Data = NEW(char, SMBUF);
+     sp->Channel->Out.Size = SMBUF;
+     sp->Channel->Out.Left = 0;
+     sp->Channel->Out.Used = 0;
+     return TRUE;
+ }
+
  /*
  **  Check if we need to write out the site's buffer.  If we're buffered
  **  or the feed is backed up, this gets a bit complicated.
***************
*** 193,207 ****
      if (sp->Type == FTfile || sp->StartSpooling == 0 || i <
sp->StartSpooling)
        return;

!     if (!SITEspool(sp, (CHANNEL *)NULL)) {
        syslog(L_ERROR, "%s overflow %d bytes", sp->Name, i);
        return;
      }
-     syslog(L_ERROR, "%s spooling %d bytes", sp->Name, i);
-     WCHANsetfrombuffer(sp->Channel, &cp->Out);
-     WCHANadd(sp->Channel);
-     CHANclose(cp, CHANname(cp));
  }


  /*
--- 237,249 ----
      if (sp->Type == FTfile || sp->StartSpooling == 0 || i <
sp->StartSpooling)
        return;

!     syslog(L_ERROR, "%s spooling %d bytes", sp->Name, i);
!     if(!SITECHANbilge(sp)) {
        syslog(L_ERROR, "%s overflow %d bytes", sp->Name, i);
        return;
      }
  }
+


  /*


--
Richard Martin
Sprintlink Systems & Services


Technical Details
Message-ID: <3smksa$l5d@news.sprintlink.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.technical.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <3smksa$l5d@news.sprintlink.net>
Subject: INN1.4 spooling Patch
Date: Tue, 27 Jun 1995 00:00:00 +0000
From: news@news.sprintlink.net
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.technical.mbox.zip!not-for-mail
X-Deja-AN: 105118110
Distribution: world
Approved: zorch@uunet.UU.NET
Sender: zorch@ftp.UU.NET
Summary: INN1.4 spooling Patch
Organization: Sprint Internetworking Services
Keywords: inn,spool,patch
Newsgroups: news.software.nntp,news.admin.technical