improved functionality for new timeout tests

This commit is contained in:
Daniel Stenberg
2001-11-02 23:09:25 +00:00
parent f34573c8e2
commit 3bfa06c9a2
3 changed files with 38 additions and 0 deletions

View File

@@ -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;