/* */ #include "FtpTunnelResponseCommand.h" #include "FtpNegotiationCommand.h" #include "DlRetryEx.h" #include "message.h" FtpTunnelResponseCommand::FtpTunnelResponseCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):AbstractCommand(cuid, req, e, s) { http = new HttpConnection(cuid, socket, req, e->option, e->logger); } 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(this); return false; } if(status != 200) { throw new DlRetryEx(EX_PROXY_CONNECTION_FAILED); } FtpNegotiationCommand* command = new FtpNegotiationCommand(cuid, req, e, socket); e->commands.push(command); return true; }