X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=d1feb3e18eb2e6dea892108a3eb15d2a8977d81f;hb=56b93915d65c299a5f2d2e555ee361c056773843;hp=9b3a371b092a8e9cd651025153e26ca9c642a71d;hpb=b9e57057d60a952bd43acdbeb2420ad7964b96f8;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 9b3a371b..d1feb3e1 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -252,6 +252,7 @@ sub start } $self->lastmsgpoll($main::systime); + $self->{user_interval} = $self->user->user_interval || $main::user_interval; # allow user to change idle time between prompts $self->prompt; } @@ -541,9 +542,9 @@ sub run_cmd $cmd =~ s|//+|/|g; # check for length of whole command line and any invalid characters - if (length $cmdline > $maxcmdlth || $cmd =~ m|\.| || $cmd !~ m|^\w+(?:/\w+){0,1}$|) { + 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); @@ -588,7 +589,7 @@ sub run_cmd 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'); } } @@ -597,11 +598,11 @@ sub run_cmd if ($ok) { delete $self->{errors}; } else { - if (++$self->{errors} > $DXChannel::maxerrors) { + if ($self != $main::me && ++$self->{errors} > $DXChannel::maxerrors) { $self->send($self->msg('e26')); $self->disconnect; return (); - } + } } return map {s/([^\s])\s+$/$1/; $_} @ans; } @@ -627,7 +628,7 @@ sub process } # 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); } @@ -881,7 +882,6 @@ sub find_cmd_name { if (isdbg('eval')) { my @list = split /\n/, $eval; - my $line; for (@list) { dbg($_ . "\n") if isdbg('eval'); }