aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-06-12 08:38:11 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-06-12 08:38:11 +0000
commite450888b15571375d5cf3e26c3b164f6bf297183 (patch)
tree06f8b7a4bf80af338582da00349cf04632f7cda0 /tests
parent23522a66d16cf3a621764a891b716992f154105e (diff)
supports SIZE now
Diffstat (limited to 'tests')
-rw-r--r--tests/ftpserver.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index b239a075e..873bcbe0d 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -162,11 +162,9 @@ sub SIZE_command {
logmsg "SIZE number $testno\n";
- my $filename = "data/reply$testno.txt";
+ my @data = getpart("reply", "size");
- my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks)
- = stat($filename);
+ my $size = $data[0];
if($size) {
print "213 $size\r\n";
@@ -198,7 +196,7 @@ sub RETR_command {
my $size=0;
for(@data) {
- $size =+ length($_);
+ $size += length($_);
}
if($size) {
@@ -206,10 +204,16 @@ sub RETR_command {
if($rest) {
# move read pointer forward
$size -= $rest;
+ if($verbose) {
+ print STDERR "** REST $rest was removed from size.\n";
+ }
}
print "150 Binary data connection for $testno () ($size bytes).\r\n";
$rest=0; # reset rest again
+ if($verbose) {
+ print STDERR "150 Binary data connection for $testno ($size bytes).\n";
+ }
for(@data) {
print SOCK $_;
}
@@ -219,6 +223,9 @@ sub RETR_command {
}
else {
print "550 $testno: No such file or directory.\r\n";
+ if($verbose) {
+ print STDERR "550 $testno: no such file\n";
+ }
}
return 0;
}