robinrodricks / FluentFTP

An FTP and FTPS client for .NET & .NET Standard, optimized for speed. Provides extensive FTP commands, File uploads/downloads, SSL/TLS connections, Automatic directory listing parsing, File hashing/checksums, File permissions/CHMOD, FTP proxies, FXP support, UTF-8 support, Async/await support, Powershell support and more. Written entirely in C#.
MIT License
3.09k stars 650 forks source link

Do not download files fully in case of using HTTP proxy #757

Closed kolebynov closed 1 year ago

kolebynov commented 3 years ago

FTP OS: Windows

FTP Server: IIS

Computer OS: Windows

FluentFTP Version: 34.0.0

HTTP Proxy: 3proxy

Sometimes FTP client doesn't download files fully if I use an HTTP proxy. In my experience, it works 50/50. For downloading I use the method IFtpClient.DownloadAsync. I tried to use IFtpClient.DownloadFileAsync, but I got the same issue. Also, I tried to use FileZilla with this proxy and everything works fine.

Logs :

# ConnectAsync()
Status:   Connecting to 127.0.0.1:3128
HTTP/1.0 200 Connection established

Response: 220 Microsoft FTP Service
Status:   Detected FTP server: WindowsServerIIS
Command:  USER ***
Response: 331 Anonymous access allowed, send identity (e-mail name) as password.
Command:  PASS ***
Response: 230 User logged in.
Command:  FEAT
Response: 211-Extended features supported:
Response: LANG EN*
Response: UTF8
Response: AUTH TLS;TLS-C;SSL;TLS-P;
Response: PBSZ
Response: PROT C;P;
Response: CCC
Response: HOST
Response: SIZE
Response: MDTM
Response: REST STREAM
Response: 211 END
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Response: 200 OPTS UTF8 command successful - UTF8 encoding now ON.
Command:  SYST
Response: 215 Windows_NT

# DownloadAsync("ARAS-1.2.1.143")

# OpenReadAsync("ARAS-1.2.1.143", Binary, 0)
Command:  TYPE I
Response: 200 Type set to I.

# OpenPassiveDataStreamAsync(AutoPassive, "RETR ARAS-1.2.1.143", 0)
Command:  EPSV
Response: 229 Entering Extended Passive Mode (|||51717|)
Status:   Connecting to 127.0.0.1:3128
HTTP/1.0 200 Connection established

Command:  RETR ARAS-1.2.1.143
Response: 125 Data connection already open; Transfer starting.
Status:   Disposing FtpSocketStream...
Response: 226 Transfer complete.
FanDjango commented 1 year ago

This issue is very old. It has not been followed up on. If it is still of interest please intervene - otherwise it will be closed soon.

The newest versions of FluentFTP will produce much more information to help debugging problems of this kind.