/* */ #ifndef _D_FTP_CONNECTION_H_ #define _D_FTP_CONNECTION_H_ #include "common.h" #include "SharedHandle.h" #include #include namespace aria2 { class Option; class Logger; class Segment; class Request; class SocketCore; class FtpConnection { private: int32_t cuid; SharedHandle socket; SharedHandle req; const Option* option; Logger* logger; std::string strbuf; unsigned int getStatus(const std::string& response) const; bool isEndOfResponse(unsigned int status, const std::string& response) const; bool bulkReceiveResponse(std::pair& response); public: FtpConnection(int32_t cuid, const SharedHandle& socket, const SharedHandle& req, const Option* op); ~FtpConnection(); void sendUser() const; void sendPass() const; void sendType() const; void sendCwd() const; void sendSize() const; void sendPasv() const; SharedHandle sendPort() const; void sendRest(const SharedHandle& segment) const; void sendRetr() const; unsigned int receiveResponse(); unsigned int receiveSizeResponse(uint64_t& size); unsigned int receivePasvResponse(std::pair& dest); }; } // namespace aria2 #endif // _D_FTP_CONNECTION_H_