mirror of
https://github.com/curl/curl.git
synced 2025-02-23 15:10:03 +08:00
Fixed the test FTP server to support the >10000 test number notation
This commit is contained in:
parent
edef367e9c
commit
4f00a02ba3
@ -337,6 +337,11 @@ sub NLST_command {
|
|||||||
|
|
||||||
sub MDTM_command {
|
sub MDTM_command {
|
||||||
my $testno = $_[0];
|
my $testno = $_[0];
|
||||||
|
my $testpart = "";
|
||||||
|
if ($testno > 10000) {
|
||||||
|
$testpart = $testno % 10000;
|
||||||
|
$testno = $testno / 10000;
|
||||||
|
}
|
||||||
|
|
||||||
loadtest("$srcdir/data/test$testno");
|
loadtest("$srcdir/data/test$testno");
|
||||||
|
|
||||||
@ -359,6 +364,11 @@ sub MDTM_command {
|
|||||||
|
|
||||||
sub SIZE_command {
|
sub SIZE_command {
|
||||||
my $testno = $_[0];
|
my $testno = $_[0];
|
||||||
|
my $testpart = "";
|
||||||
|
if ($testno > 10000) {
|
||||||
|
$testpart = $testno % 10000;
|
||||||
|
$testno = $testno / 10000;
|
||||||
|
}
|
||||||
|
|
||||||
loadtest("$srcdir/data/test$testno");
|
loadtest("$srcdir/data/test$testno");
|
||||||
|
|
||||||
@ -383,7 +393,7 @@ sub SIZE_command {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$size=0;
|
$size=0;
|
||||||
@data = getpart("reply", "data");
|
@data = getpart("reply", "data" . $testpart);
|
||||||
for(@data) {
|
for(@data) {
|
||||||
$size += length($_);
|
$size += length($_);
|
||||||
}
|
}
|
||||||
@ -416,17 +426,22 @@ sub RETR_command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$testno =~ s/^([^0-9]*)//;
|
$testno =~ s/^([^0-9]*)//;
|
||||||
|
my $testpart = "";
|
||||||
|
if ($testno > 10000) {
|
||||||
|
$testpart = $testno % 10000;
|
||||||
|
$testno = $testno / 10000;
|
||||||
|
}
|
||||||
|
|
||||||
loadtest("$srcdir/data/test$testno");
|
loadtest("$srcdir/data/test$testno");
|
||||||
|
|
||||||
my @data = getpart("reply", "data");
|
my @data = getpart("reply", "data" . $testpart);
|
||||||
|
|
||||||
my $size=0;
|
my $size=0;
|
||||||
for(@data) {
|
for(@data) {
|
||||||
$size += length($_);
|
$size += length($_);
|
||||||
}
|
}
|
||||||
|
|
||||||
my %hash = getpartattr("reply", "data");
|
my %hash = getpartattr("reply", "data" . $testpart);
|
||||||
|
|
||||||
if($size || $hash{'sendzero'}) {
|
if($size || $hash{'sendzero'}) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user