1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

supports SIZE now

This commit is contained in:
Daniel Stenberg 2001-06-12 08:38:11 +00:00
parent 23522a66d1
commit e450888b15

View File

@ -162,11 +162,9 @@ sub SIZE_command {
logmsg "SIZE number $testno\n"; 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, my $size = $data[0];
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
if($size) { if($size) {
print "213 $size\r\n"; print "213 $size\r\n";
@ -198,7 +196,7 @@ sub RETR_command {
my $size=0; my $size=0;
for(@data) { for(@data) {
$size =+ length($_); $size += length($_);
} }
if($size) { if($size) {
@ -206,10 +204,16 @@ sub RETR_command {
if($rest) { if($rest) {
# move read pointer forward # move read pointer forward
$size -= $rest; $size -= $rest;
if($verbose) {
print STDERR "** REST $rest was removed from size.\n";
}
} }
print "150 Binary data connection for $testno () ($size bytes).\r\n"; print "150 Binary data connection for $testno () ($size bytes).\r\n";
$rest=0; # reset rest again $rest=0; # reset rest again
if($verbose) {
print STDERR "150 Binary data connection for $testno ($size bytes).\n";
}
for(@data) { for(@data) {
print SOCK $_; print SOCK $_;
} }
@ -219,6 +223,9 @@ sub RETR_command {
} }
else { else {
print "550 $testno: No such file or directory.\r\n"; print "550 $testno: No such file or directory.\r\n";
if($verbose) {
print STDERR "550 $testno: no such file\n";
}
} }
return 0; return 0;
} }