improved functionality for new timeout tests
This commit is contained in:
@@ -326,6 +326,7 @@ sub PORT_command {
|
||||
$SIG{CHLD} = \&REAPER;
|
||||
|
||||
my %customreply;
|
||||
my %delayreply;
|
||||
sub customize {
|
||||
undef %customreply;
|
||||
open(CUSTOM, "<log/ftpserver.cmd") ||
|
||||
@@ -337,6 +338,9 @@ sub customize {
|
||||
if($_ =~ /REPLY ([A-Z]+) (.*)/) {
|
||||
$customreply{$1}=$2;
|
||||
}
|
||||
elsif($_ =~ /DELAY ([A-Z]+) (\d*)/) {
|
||||
$delayreply{$1}=$2;
|
||||
}
|
||||
}
|
||||
close(CUSTOM);
|
||||
}
|
||||
@@ -416,6 +420,12 @@ for ( $waitedpid = 0;
|
||||
$state = $newstate;
|
||||
}
|
||||
|
||||
my $delay = $delayreply{$FTPCMD};
|
||||
if($delay) {
|
||||
# just go sleep this many seconds!
|
||||
sleep($delay);
|
||||
}
|
||||
|
||||
my $text;
|
||||
$text = $customreply{$FTPCMD};
|
||||
my $fake = $text;
|
||||
|
||||
Reference in New Issue
Block a user