mattnenterprise / rust-ftp

FTP client for Rust
Apache License 2.0
182 stars 57 forks source link

list() is waiting indefinitely #54

Closed 17dec closed 7 years ago

17dec commented 8 years ago

Currently having an issue to get a file listing from the FreeBSD ftp archive. The following code fails:

    let host = "ftp-archive.freebsd.org:21";
    let path = "/mirror/FreeBSD-Archive/old-releases/i386/2.2.8-RELEASE/packages/Latest";

    let mut ftp = ftp::FtpStream::connect(host).unwrap();
    ftp.login("anonymous", "").unwrap();
    let lst = ftp.list(Some(path)).unwrap();
    for i in lst {
        println!("LIST: {}", i);
    }

Using strace I can see that a new passive connection is opened and I can see that the file listing is received, but list() only returns after the server eventually replies with a "426 Data connection: Bad file descriptor.".

This is with rustc 1.15.0-nightly (ba872f270 2016-11-17) and ftp 2.0.0 on Linux.