ashkulz / NppFTP

Plugin for Notepad++ allowing FTP, FTPS, FTPES and SFTP communications
https://ashkulz.github.io/NppFTP/
322 stars 93 forks source link

Data transfer on FTPs stalls at About to start, then after 20 or so seconds carries on. #324

Open Rolf-Herbert opened 2 years ago

Rolf-Herbert commented 2 years ago

Description of the Issue

When connecting to an FTPs server (Filezilla server) and transfer a file it gets stick on 'About to start data transfer' for ages then eventually uplaods without issue. The percentage uploaded shoots straight to 100% (these are fairly small files) but wont 'complete'

If I connect via filezilla I dont get the issue.

I can download a file without issue

Expected Behavior

The file to upload normally

Actual Behavior

Gets stuck

Debug Information

Notepad++ v8.1.4 (64-bit) Build time : Aug 21 2021 - 13:04:59 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Home (64-bit) OS Version : 2009 OS Build : 19042.1288 Current ANSI codepage : 1252 Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll NppFTP.dll

0.29.8

FTPs Explicit

password

Thanks

Rolf-Herbert commented 2 years ago

PS I have also tried a couple of other FTP programs, WinSCP etc and they work without issue with the same setup

chcg commented 2 years ago

@TeamKinetic Against which version of https://filezilla-project.org/versions.php?type=server do you test?

Could be reproduced with filezilla server 1.0.1:

grafik

Happens for FTPES and FTPS. It happens also for bigger files:

grafik

The final on_read() call of the TLS layer has a 1 minute delay in my case. So I think something in the TLS communication needs to be changed to signal the end of the data upload also it is not clear to me what needs to be changed.

It doesn't happen for just plain FTP connections.

Rolf-Herbert commented 2 years ago

@chcg 1.0.1 (latest as of 25/10/2021)

Thanks

AyrA commented 2 years ago

@TeamKinetic If I had to guess, there may be some buffered data that's not flushed. 1 Minute is probably the delay where the TLS buffer gets flushed automatically, maybe due to key renegotiation.

When using AES, packets are sent in 16 byte increments, and padding must be added at the end. This means data cannot be reliably flushed to the TCP stream unless the TLS implementation knows whether there is more data to be sent or not.

This is also an issue with differen FTP servers. I tried it with IIS and had the same problem.

maxxnino commented 1 year ago

I don’t know if it helps. I got this error too, but after setting the passive mode ports and allowing all of those ports through the Windows firewall, the issue was fixed for me