문제

I'm creating an FTP server in Qt, and I'm not sure when to send the 226 success response code for a RETR command.

Do I send it after all the data is written, but before the data connection socket is closed:

    reply(226);
    dataSocket()->disconnectFromHost();

or do I send it after the data connection socket is closed:

    dataSocket()->disconnectFromHost();
    dataSocket()->waitForDisconnected();
    reply(226);
도움이 되었습니까?

해결책

http://www.ietf.org/rfc/rfc959.txt

To prevent a race condition here, the server sends a reply (226) after closing the data connection.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top