Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftp::getDirectoryListing typo fix #1100

Closed
wants to merge 1 commit into from
Closed

Ftp::getDirectoryListing typo fix #1100

wants to merge 1 commit into from

Conversation

DJMaster
Copy link

NLST changed to LIST

@DJMaster DJMaster closed this Jun 17, 2016
@DJMaster DJMaster deleted the patch-1 branch June 17, 2016 23:38
@LaurentGomila
Copy link
Member

It's not a typo, the command is NLST...

@nabijaczleweli
Copy link

That's probably why OP closed the PR and deleted the branch.

@DJMaster
Copy link
Author

Yep, sorry. I realised my mistake just a second after the opening of the merge request.

As Laurent suggested by email, it seems like my FTP server doesn't support the NLST command.

Infact I was using "smallftpd" and looking at the resulting code I've found sfFtpStatus equal to sfFtpCommandUnknown = 500, ///< Syntax error, command unrecognized

I've then tested my code with "Xlight FTP Server" locally and something changed:

06/18/2016 11:03:01 (not login 127.0.0.1<--127.0.0.1:21) "220 Xlight FTP Server 3.8 ready..."
06/18/2016 11:03:04 (not login 127.0.0.1-->127.0.0.1:21) "USER user"
06/18/2016 11:03:04 (not login 127.0.0.1<--127.0.0.1:21) "331 Password required for user"
06/18/2016 11:03:05 (not login 127.0.0.1-->127.0.0.1:21) "PASS *****"
06/18/2016 11:03:05 (user 127.0.0.1<--127.0.0.1:21) "230 Login OK"
06/18/2016 11:03:05 (user 127.0.0.1-->127.0.0.1:21) "PWD"
06/18/2016 11:03:05 (user 127.0.0.1<--127.0.0.1:21) "257 "/""
06/18/2016 11:03:06 (user 127.0.0.1-->127.0.0.1:21) "PASV"
06/18/2016 11:03:06 (user 127.0.0.1<--127.0.0.1:21) "227 Entering Passive Mode (127,0,0,1,230,179)"
06/18/2016 11:03:06 (user 127.0.0.1-->127.0.0.1:21) "TYPE A"
06/18/2016 11:03:06 (user 127.0.0.1<--127.0.0.1:21) "200 Type set to A."
06/18/2016 11:03:06 (user 127.0.0.1-->127.0.0.1:21) "NLST"
06/18/2016 11:03:06 (user 127.0.0.1<--127.0.0.1:21) "150 Opening ASCII mode data connection for NLIST (24 bytes)."
06/18/2016 11:03:06 (user 127.0.0.1<--127.0.0.1:21) "226 Transfer complete (0.169 KB/s)."

Ascii data is sent from Server to Client, but it looks like that now I have the same problem mentioned here: #1086

My application "hangs" right after the sfFtp_getDirectoryListing call:

  begin
    // Print the contents of the current server directory
    WriteLn('Before sfFtp_getDirectoryListing'); // <---------------- I can read this log line on screen
    ListingResponse := sfFtp_getDirectoryListing(Server, nil); // <-- the Client hangs right here!
    WriteLn('After sfFtp_getDirectoryListing');
    if (sfFtpListingResponse_isOk(ListingResponse) = sfFalse) then
    begin
      WriteLn('ListingResponse Status: ', sfFtpListingResponse_getStatus(ListingResponse));
      WriteLn('ListingResponse Message: ', PChar(sfFtpListingResponse_getMessage(ListingResponse)));
    end
    else
    begin
      WriteLn('ListingResponse Status: ', sfFtpListingResponse_getStatus(ListingResponse));
      WriteLn('ListingResponse Message: ', PChar(sfFtpListingResponse_getMessage(ListingResponse)));
      WriteLn('ListingResponse Count: ', sfFtpListingResponse_getCount(ListingResponse));
      for Index := 0 to sfFtpListingResponse_getCount(ListingResponse) - 1 do
        WriteLn(string(sfFtpListingResponse_getName(ListingResponse, Index)));
    end;
    sfFtpListingResponse_destroy(ListingResponse);
  end;

I forgot to mention that I'm using CSFML, called with a new FreePascal
binding I'm working on.

..

Furthermore I've just tried to use latest SFML development version binaries to see if latest patches
have solved this problem, but as you can see in the attached images it fails even with DLL version of June 11th, obtained from http://www.sfml-dev.org/artifacts/by-branch/master/

ftp

Does snapshot from June 11th include the following commit related to this issue? c15172e

Any comment/suggestion about this Ftp.exe behaviour?

Thank You in advance for your answers.

Sandro

@LaurentGomila
Copy link
Member

LaurentGomila commented Jun 18, 2016

By default CSFML links SFML statically on Windows. Are you sure that these DLLs are even used at all?

Take the latest master, there's no point using an outdated source.

@DJMaster
Copy link
Author

You are right, sfml dlls are not used.

I was using a different set of dlls in my previous testings, coming from the msys2-mingw-w64 environment, where csfml dlls refer to sfml dlls dynamically.

It seems that I need a fresh set of csfml dlls... is there an updated binary snapshot somewhere?

@LaurentGomila
Copy link
Member

It seems that I need a fresh set of csfml dlls... is there an updated binary snapshot somewhere?

I don't think so.

@DJMaster
Copy link
Author

Well, with a fresh set of SFML/CSFML dlls the Ftp.exe demo is listing remote directories correctly.

Thank you very much for your prompt support, really appreciated!

Sandro

screen

@LaurentGomila
Copy link
Member

Great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants