bentonstark / starksoft-aspen

.net / mono security and cryptography library that provides client support for ftps, gnupg, smartcard, and socks / http proxies
108 stars 49 forks source link

EPSV Extended Passive Mode performance issue ? #38

Closed ghost closed 2 years ago

ghost commented 6 years ago

Seems like the proftpd on Linux Mint responds with EPSV when Aspen is requesting PASV. I found out a clue, the same server responds with PASV when using Filezilla as the client.

However, all the commands move very slow in Aspen, the obvious difference is EPSV, I am not sure yet if it's the server laptop performance issue, Aspen C# performance in parsing, the usual server I'm connecting to with this C# program doesn't have EPSV and it's a mini-version with only basic stuff so it never responsed with EPSV AFAIK, so PASV does work

I also tried disabling Facts, with FactsAdvertise off, but didn't help.

I tried using Active with Aspen, it solved the performance issue. I'm just wondering if this is something normal and known about EPSV?

Each command takes 2 seconds, no matter what kind of command it is, making downloading lots of small files a big problem, while the data transfer it self is not affected, it works at max speed I am expecting from this LAN setup.

EDIT: Sorry, it is Aspen that is requesting EPSV specifically, but if the server refuses it, I made that through DenyAll , it throws an exception.

I have my program throw a fatal error and close the connection at any Aspen exception, not sure how severe this is if it would continue falling back to PASV, it should if it doesn't. It throws out "System.ArgumentOutOfRangeException: "Length cannot be less than zero." on line https://github.com/bentonstark/starksoft-aspen/blob/master/Starksoft.Aspen/Ftps/FtpsBase.cs#L2591

EDIT2: Didn't help disabling IPV6 in proftpd.conf - I guess I'll just have to force it to use PASV when passive or just keep using active since it's all in LAN and both work just as fine.

bentonstark commented 5 years ago

I have not extensively tested with proftpd. All automated testing is against FileZilla. It is possible there is a wait condition that is having to time out with proftpd when using EPSV. I will have to take a deeper look at it later.