🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #76375

Re: INND and nocem

#76375
From: Julien ÉLIE
Date: Fri, 14 Sep 2007 16:56
76 lines
3445 bytes
En réponse à Ray Banana :
> man perl-nocem exists, too.

An improved man page for perl-nocem can be found here:

http://www.eyrie.org/~eagle/software/inn/docs/perl-nocem.html

It is more up to date (and verbose too).
It works fine with INN 2.4 and INN 2.5.


Do not forget to patch your perl-nocem script with that:

perl-nocem will now check for a timeout and re-open the socket
if required.  Additionally, perl-nocem will switch to
cancel_ctlinnd in case cancel_nntp fails after sending
the Message-ID.  Thanks to Christoph Biedl for the patch.

Modified: perl-nocem
===================================================================
--- perl-nocem.in 2007-08-04 10:02:52 UTC (rev 7629)
+++ perl-nocem.in 2007-08-04 17:24:40 UTC (rev 7630)
@@ -38,6 +38,8 @@
 my $use_syslog = 0;
 my $log_open = 0;
 my $nntp_open = 0;
+my $last_cancel = 0;
+my $socket_timeout = $inn::peertimeout - 100;

 my $logfile = $inn::pathlog . '/perl-nocem.log';

@@ -371,6 +373,11 @@
     my $ids = shift;
     my $r;

+    if ($nntp_open and time - $socket_timeout > $last_cancel) {
+ logmsg('Close socket for timeout');
+ close (NNTP);
+ $nntp_open = 0;
+    }
     if (not $nntp_open) {
         use Socket;
         if (not socket(NNTP, PF_UNIX, SOCK_STREAM, 0)) {
@@ -400,8 +407,10 @@
         if (($r = <NNTP>) !~ /^289/) {
             $r =~ s/\r\n$//;
             logmsg("cannot cancel $_: $r", 'err');
+            goto ERR;
         }
     }
+    $last_cancel = time;
     return;

 ERR:
+    # discard unusable socket
+    close (NNTP);
     logmsg('Switching to ctlinnd...', 'err');
     cancel_ctlinnd($ids);
     $cancel = \&cancel_ctlinnd;
@@ -463,7 +472,7 @@

 # lint food
 print $inn::pathrun.$inn::pathlog.$inn::pathetc.$inn::newsbin.$inn::pathbin
-    . $inn::pathtmp;
+    . $inn::pathtmp.$inn::syslog_facility.$inn::peertimeout;

 __END__


-- 
Julien ÉLIE

« Quand on sait que le pied vaut environ 33 cm et que l'alexandrin
  compte 12 pieds, il est facile de calculer qu'un stade vaut
  environ 42 alexandrins. » (Astérix) 
Technical Details
Message-ID: <fceehe$k0f$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!club-internet.fr!feedme-small.clubint.net!news.netfinity.fr!news.trigofacile.com!not-for-mail
References: <fceciv$nmg$1@aioe.org> <80d4wl9p9a.fsf@banana.shacknet.nu>

Show Full Headers
Complete Article Headers
Message-ID: <fceehe$k0f$1@news.trigofacile.com>
Subject: Re: INND and nocem
Date: Fri, 14 Sep 2007 18:56:14 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <fceciv$nmg$1@aioe.org> <80d4wl9p9a.fsf@banana.shacknet.nu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!club-internet.fr!feedme-small.clubint.net!news.netfinity.fr!news.trigofacile.com!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 76
NNTP-Posting-Host: goret.via.ecp.fr
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
 reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: news.trigofacile.com 1189789038 20495 138.195.145.8 (14 Sep 2007
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Fri, 14 Sep 2007 16:57:18 +0000 (UTC)
In-Reply-To: <80d4wl9p9a.fsf@banana.shacknet.nu>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6000.16480
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480