Make the SLOWDOWN option slow the FTP data connection, not just the
control connection.
This commit is contained in:
parent
5e3c2af236
commit
4d50b9f1f1
@ -207,6 +207,15 @@ sub sockfilt {
|
||||
}
|
||||
|
||||
|
||||
sub sockfiltsecondary {
|
||||
my $l;
|
||||
foreach $l (@_) {
|
||||
printf DWRITE "DATA\n%04x\n", length($l);
|
||||
print DWRITE $l;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Send data to the client on the control stream, which happens to be plain
|
||||
# stdout.
|
||||
|
||||
@ -237,8 +246,17 @@ sub sendcontrol {
|
||||
sub senddata {
|
||||
my $l;
|
||||
foreach $l (@_) {
|
||||
printf DWRITE "DATA\n%04x\n", length($l);
|
||||
print DWRITE $l;
|
||||
if(!$controldelay) {
|
||||
# spit it all out at once
|
||||
sockfiltsecondary $l;
|
||||
}
|
||||
else {
|
||||
# pause between each byte
|
||||
for (split(//,$l)) {
|
||||
sockfiltsecondary $_;
|
||||
select(undef, undef, undef, 0.01);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user