Hi, Thomas. 

> I dont have your old code here in vacation - but it should look like

Understood. Thanks for taking the time to reply. I can wait for details until 
you’re back home. 

> sub mlogWrite {
>    return if $WorkerNumber;
>    my @m;
>    my $items;
>    threads->yield();
>    &debugWrite();
>    threads->yield;
>    $items = $mlogQueue->pending();

My assp is, apparently, old enough that $nextlog does not exist in my version. 
:-/  Here’s the total of the subroutine, with my attempted addition: 

sub mlogWrite {
    my @m;
    my $items;

    &debugWrite();
#
# 20140217: THJ added next two lines to delay log writing frequency to help 
fail2ban. Start small, with 3 seconds
    return if $nextlog < time;
    $nextLog = time + 3;
#
    $items = $mlogQueue->pending();
    $refreshWait = time - $lastmlogWrite > 5 ? 5 : 1;
    return if (! $items);
    @m = $mlogQueue->dequeue_nb($items);
#    eval('no bytes;');
    no bytes;
    my @tosyslog;
    while (@m) {
       my $line = shift @m;
       eval{
           $line = Encode::decode('Guess', $line);
       } if $line;
       print $line unless $silent;
       push @tosyslog,substr($line,length($LogDateFormat)) if ($CanUseSyslog || 
$CanUseNetSyslog) && $sysLog;
       w32dbg($line) if ($CanUseWin32Debug);
       print $LOG $line if ($logfile && $asspLog && fileno($LOG));
       print $LOGBR $line if ($logfile &&
                              $asspLog &&
                              fileno($LOGBR) &&
                              $ExtraBlockReportLog &&
                              $line =~ /\[\s*spam\sfound\s*\]/io);
       if ($line !~ /page:\/maillog/o) {
           shift @RealTimeLog if (@RealTimeLog > 33);
           push @RealTimeLog, $line;
           $lastmlogWrite = time;
       }
    }
    tosyslog('info', \@tosyslog) if ($CanUseSyslog || $CanUseNetSyslog) && 
$sysLog;
#    eval('use bytes;');
    use bytes;
    $MainThreadLoopWait = 1;
}


This provoked a detailed error: 

2/17/14 17 Feb, 12:30:29 Global symbol "$nextlog" requires explicit package 
name at assp.pl line 9980. 
2/17/14 17 Feb, 12:30:29 Global symbol "$nextLog" requires explicit package 
name at assp.pl line 9981. 

These were the lines I added. I presume my old version of the subroutine deals 
with the write time in the next few lines of code. 

When you have a moment, and if you have any ideas, I’d be really grateful. 
Don’t take time away from your vacation, though. 

All the best, 

T. 
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test

Reply via email to