🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by news Tue, 27 Jun 1995 00:00
INN1.4 spooling Patch
#3681
Author: 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


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads