+02May01=======================================================================
+1. put an upper limit on the number of concurrent errors allowed in command
+mode (20). This should disconnect runaway spot suckers....
28Apr01=======================================================================
1. fix an occasional problem with 'sorry connected to' messages
23Apr01=======================================================================
talklist => '0,Talk List,parray',
cluster => '5,Cluster data',
isbasic => '9,Internal Connection',
+ errors => '9,Errors',
);
# object destruction
use Internet;
use strict;
-use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase);
+use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors);
%Cache = (); # cache of dynamically loaded routine's mod times
%cmd_cache = (); # cache of short names
$errstr = (); # error string from eval
%aliases = (); # aliases for (parts of) commands
$scriptbase = "$main::root/scripts"; # the place where all users start scripts go
+$maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection
#
# obtain a new connection this is derived from dxchannel
}
} else {
dbg('command', "cmd: $cmd not found");
- return ($self->msg('e1'));
+ if (++$self->{errors} > $maxerrors) {
+ $self->send($self->msg('e26'));
+ $self->disconnect;
+ return ();
+ } else {
+ return ($self->msg('e1'));
+ }
}
}
}
- shift @ans;
+ my $ok = shift @ans;
+ if ($ok) {
+ delete $self->{errors};
+ } else {
+ if (++$self->{errors} > $maxerrors) {
+ $self->send($self->msg('e26'));
+ $self->disconnect;
+ return ();
+ }
+ }
return (@ans);
}