Please look at the Changes for an explanation.
I have do the prep work for allowing users to alter the prompt
idle timer (currently fixed to 11 minutes). The cmd has yet to be
written.
+04Mar23=======================================================================
+1. Fixed regression caused by too many command errors in (startup) script
+ files. This is caused by much stricter checking of commands entered both
+ by users AND scripts. If there more concurrent errors ie. greater than
+ $DXChannel::maxerrors (default 10) then that user will be disconnected.
+
+ Unfortunately this could include the $mycall (node) channel if there were
+ too many command users in the startup script. The example I looked at had
+ a load of HTML pasted into it.
+
+ For various reasons the only manifestation of this problem was that pings
+ no longer worked.
+
+ This has been fixed. I am grateful to Fulvio HB9DHG for letting me break
+ his node for an hour or so until I worked out what was going on.
03Mar23=======================================================================
1. Fix DXDebug::DXDebug not found errors in rarely used functions. This is
also an interaction with differing versions of Mojolicious. Clearly this
use Filter;
use Prefix;
use Route;
+use DXLog;
+
use strict;
use vars qw(%channels %valid @ISA $count $maxerrors);
talk => '0,Want Talk,yesno',
talklist => '0,Talk List,parray',
user => '9,DXUser ref',
+ user_interval => '0,Prompt Idle Time',
ve7cc => '0,VE7CC program special,yesno',
verified => '9,Verified?,yesno',
version => '1,Node Version',
wx => '0,Want WX,yesno',
);
-$maxerrors = 5; # the maximum number of concurrent errors allowed before disconnection
+$maxerrors = 10; # the maximum number of concurrent errors allowed before disconnection
# object destruction
sub DESTROY
{
my $self = shift;
my $e = shift;
- if (++$self->{errors} > $maxerrors) {
+ if ($self != $main::me && ++$self->{errors} > $maxerrors) {
$self->send($self->msg('e26'));
+ LogDbg('err', "DXChannel $self->{call}: too many errors ($self->{errors} > $maxerrors), disconnecting");
$self->disconnect;
return ();
} else {
- return ($self->msg($e));
+ return ($e ? $self->msg($e) : '');
}
}
}
$self->lastmsgpoll($main::systime);
+ $self->{user_interval} = $self->user->user_interval || $main::user_interval; # allow user to change idle time between prompts
$self->prompt;
}
# check for length of whole command line and any invalid characters
if (length $cmdline > $maxcmdlth || $cmd =~ m|\.| || $cmd !~ m|^\w+(?:/\w+){0,1}(?:/\d+)?$|) {
LogDbg('DXCommand', "cmd: $self->{call} - invalid characters in '$cmd'");
- return $self->_error_out('e40');
+ return $self->_error_out('e40');
}
my ($path, $fcmd);
return $self->_error_out('e1');
}
} else {
- dbg("cmd: $cmd not found") if isdbg('command');
+ LogDbg('DXCommand', "$self->{call} cmd: '$cmd' not found");
return $self->_error_out('e1');
}
}
if ($ok) {
delete $self->{errors};
} else {
- if (++$self->{errors} > $DXChannel::maxerrors) {
- $self->send($self->msg('e26'));
- $self->disconnect;
- return ();
- }
+ return $self->_error_out('e26');
}
return map {s/([^\s])\s+$/$1/; $_} @ans;
}
}
# send a prompt if no activity out on this channel
- if ($t >= $dxchan->t + $main::user_interval) {
+ if ($t >= $dxchan->t + $dxchan->{user_interval}) {
$dxchan->prompt() if $dxchan->{state} =~ /^prompt/o;
$dxchan->t($t);
}
rbnseeme => '0,RBN See Me,yesno',
registered => '9,Registered?,yesno',
startt => '0,Start Time,cldatetime',
+ user_interval => '0,Prompt IdleTime',
version => '1,Version',
wantann => '0,Req Announce,yesno',
wantann_talk => '0,Talklike Anns,yesno',