/* */ #include "FtpTunnelResponseCommand.h" #include "FtpNegotiationCommand.h" #include "DlRetryEx.h" #include "message.h" FtpTunnelResponseCommand::FtpTunnelResponseCommand(int cuid, Request* req, DownloadEngine* e, const Socket* s):AbstractCommand(cuid, req, e, s) { http = new HttpConnection(cuid, socket, req, e->option); } FtpTunnelResponseCommand::~FtpTunnelResponseCommand() { delete http; } bool FtpTunnelResponseCommand::executeInternal(Segment segment) { HttpHeader headers; int status = http->receiveResponse(headers); if(status == 0) { // we didn't receive all of headers yet. e->commands.push_back(this); return false; } if(status != 200) { throw new DlRetryEx(EX_PROXY_CONNECTION_FAILED); } FtpNegotiationCommand* command = new FtpNegotiationCommand(cuid, req, e, socket); e->commands.push_back(command); return true; }