INN commit: trunk/control (perl-nocem.in)
INN Commit
Russ_Allbery at isc.org
Sat Aug 4 17:24:40 UTC 2007
Date: Saturday, August 4, 2007 @ 10:24:40
Author: iulius
Revision: 7630
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:
trunk/control/perl-nocem.in
---------------+
perl-nocem.in | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
Modified: perl-nocem.in
===================================================================
--- 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:
@@ -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__
More information about the inn-committers
mailing list