Coder Social home page Coder Social logo

Comments (8)

FanDjango avatar FanDjango commented on June 1, 2024 1

@adfansong I merged a fix for this and perhaps you can check it out on the current master?

from fluentftp.

FanDjango avatar FanDjango commented on June 1, 2024

I need to see a complete log, (nearly) all the responses are missing (or are there none?).

[Verbose] Status:   Waiting for response to: RETR /2.dzip

Why does this appear 3 times? Need to see your source code.

What is the server type? FileZilla or IIS? Which version FileZilla?

Using Mono: always a bit difficult to help with that. Please supply more information.

from fluentftp.

FanDjango avatar FanDjango commented on June 1, 2024

Oh, and try using passive FTP mode instead of ACTIVE mode.

from fluentftp.

adfansong avatar adfansong commented on June 1, 2024

I need to see a complete log, (nearly) all the responses are missing (or are there none?).

[Verbose] Status:   Waiting for response to: RETR /2.dzip

Why does this appear 3 times? Need to see your source code.

What is the server type? FileZilla or IIS? Which version FileZilla?

Using Mono: always a bit difficult to help with that. Please supply more information.

Thanks for your reply.

  1. I wrote a simple test to get logs and stacks.
[Verbose] >         Connect(False)

[Verbose] Status:   FluentFTP 49.0.2.0(.NET Standard 2.1) AsyncFtpClient

[Info] Status:   Connecting to IP #1= ***:21

[Verbose] Status:   Waiting for a response

[Verbose] Response: 220-FileZilla Server 1.8.1

[Info] Response: 220 Please visit https://filezilla-project.org/ [738944.456d]

[Info] Status:   Detected FTP server: FileZilla

[Info] Command:  USER ***

[Verbose] Status:   Waiting for response to: USER ***

[Info] Response: 331 Please, specify the password. [109ms]

[Info] Command:  PASS ***

[Verbose] Status:   Waiting for response to: PASS ***

[Info] Response: 230 Login successful. [139ms]

[Info] Command:  FEAT

[Verbose] Status:   Waiting for response to: FEAT

[Verbose] Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT

[Info] Response: 211 End [444ms]

[Info] Status:   Text encoding: System.Text.UTF8Encoding

[Info] Command:  OPTS UTF8 ON

[Verbose] Status:   Waiting for response to: OPTS UTF8 ON

[Info] Response: 202 UTF8 mode is always enabled. No need to send this command [187ms]

[Info] Command:  SYST

[Verbose] Status:   Waiting for response to: SYST

[Info] Response: 215 UNIX emulated by FileZilla. [81ms]

[Verbose] Status:   Active ServerHandler is: FileZilla

[Verbose] Status:   Listing parser set to: Machine

[Info] Command:  PWD

[Verbose] Status:   Waiting for response to: PWD

[Info] Response: 257 "/" is current directory. [75ms]

connected.

[Verbose] >         DownloadFile("e://soft/download/1.dzip", "/1.dzip", Resume, None)

[Verbose] >         OpenRead("/1.dzip", Binary, 0, 0, False)

[Verbose] >         GetFileSize("/1.dzip", -1)

[Info] Command:  SIZE /1.dzip

[Verbose] Status:   Waiting for response to: SIZE /1.dzip

[Info] Response: 213 346 [23ms]

[Info] Command:  TYPE I

[Verbose] Status:   Waiting for response to: TYPE I

[Info] Response: 200 Type set to I [50ms]

[Verbose] >         OpenDataStreamAsync("RETR /1.dzip", 0)

[Verbose] >         OpenPassiveDataStreamAsync(AutoPassive, "RETR /1.dzip", 0)

[Info] Command:  EPSV

[Verbose] Status:   Waiting for response to: EPSV

[Info] Response: 229 Entering Extended Passive Mode (|||11382|) [139ms]

[Info] Status:   Connecting to IP #1= ***:11382

[Info] Command:  RETR /1.dzip

[Verbose] Status:   Waiting for response to: RETR /1.dzip

[Info] Response: 150 Starting data transfer. [72ms]

[Verbose] Status:   Downloaded 346 bytes

[Verbose] Status:   AsyncFtpClient incorrectly called Close(sync)

[Verbose] Status:   Disposing(sync) FtpSocketStream(data connection of AsyncFtpClient)

[Verbose] >         CloseDataStream()

[Verbose] Status:   Waiting for response to: RETR /1.dzip

[Info] Response: 226 Operation successful [93ms]

[Verbose] Status:   Waiting for response to: RETR /1.dzip

[Verbose] Status:   Disposing(async) FtpSocketStream(control connection of AsyncFtpClient)

[Verbose] Status:   AsyncFtpClient incorrectly called Close(sync)

TimeoutException: Timed out trying to read data from the socket stream!

stack.txt

The test code:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using FluentFTP;
using UnityEngine;

public class FluentFTPTest : MonoBehaviour {
    public string host = "192.168.0.103";
    public string user = "test";
    public string pwd = "123";
    public int port = 0;

    private AsyncFtpClient client;
    
    // Start is called before the first frame update
    void Start() {
        testCo();
    }

    async Task testCo() {
        try {
            var tokenSource = new CancellationTokenSource();
            
            var client = new AsyncFtpClient(host, user, pwd, port);
            // TEST
            client.Config.LogToConsole = true;
            client.Config.DataConnectionType = FtpDataConnectionType.AutoPassive;
            client.LegacyLogger = (level, s) => {
                Debug.Log($"[{level}] {s}");
            };

            await client.Connect(tokenSource.Token);
            
            Debug.Log("connected.");
            
            await client.DownloadFile("e://soft/download/1.dzip", "/1.dzip", token:tokenSource.Token);
            
            Debug.Log("done.");
        } catch (Exception e) {
            Debug.LogException(e);
            throw;
        }
    }
}

for 3 times:

  1. FtpSocketStream/
  2. .AsyncFtpClient/ -> FtpDataStream:Close
  3. .AsyncFtpClient/ -> GetReplyInternal
  1. Now I use FileZilla Server 1.8.1, IIS the same before

from fluentftp.

adfansong avatar adfansong commented on June 1, 2024

Oh, and try using passive FTP mode instead of ACTIVE mode.

How to set that?

I tried to set DataConnectionType to AutoPassive / PASV, same error.

from fluentftp.

FanDjango avatar FanDjango commented on June 1, 2024

Ok, I see the source code.

And I made a mistake concerning ACTIVE/PASSIVE, I was in a hurry. It is PASSIVE (see the EPSV, means extended passive mode). My bad.

from fluentftp.

FanDjango avatar FanDjango commented on June 1, 2024

I am able to reproduce the problem and am looking for a fix. Thanks for reporting this!

from fluentftp.

adfansong avatar adfansong commented on June 1, 2024

@adfansong I merged a fix for this and perhaps you can check it out on the current master?

Thanks for your quick support, it's ok now!

from fluentftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.