0

I'm implementing a simple FTP server. When debugging, I try to use FileZilla client to connet my server. The request and response pattern found in the command panel is listed below:

GREETING: 220 (FTP v1.0)
REQUEST:  USER ***
RESPONS:  331 Password?
REQUEST:  PASS ********
RESPONS:  230 login successfully.
REQUEST:  PWD
RESPONS:  257 "/a/" is current directory.
REQUEST:  TYPE I
RESPONS:  200 Type set to I.
REQUEST:  PASV
RESPONS:  200 127,255,0,0,175,200(I specify local port 45000)
REQUEST:  LIST
RESPONS:  150 here is the listing
RESPONS:  226 Transfer done.

However, there is an error followed Fail to read directroy. I think the passive connection is indeed established since I can get stream on the socket(I implement the server in C#). But I have no idea why is the error. Is it because I should send some handshake/greeting information like those in the control connection instead of sending the data directly to sync server and client? If yes, what's the status code of this information?

Thanks and Best Regards.

Summer_More_More_Tea
  • 12,740
  • 12
  • 51
  • 83

1 Answers1

1

There is no handshake on data connection.

Maybe 'Fail to read directory' error is a result of incorrect format of the folder list your server returns?

Pawel Lesnikowski
  • 6,264
  • 4
  • 38
  • 42
  • perhaps, I use some dummy data for testing, will refine this module and test again. Thank you. – Summer_More_More_Tea Apr 27 '12 at 08:53
  • You're right. Format is one thing, the other is that I left the connection open after data transfer complete. Curious about why FileZilla take this policy, maybe all the operations complete in a single thread? Will check the src if I have time. – Summer_More_More_Tea Apr 27 '12 at 13:26