/* */ #include "HttpDownloadCommand.h" #include "RequestGroup.h" #include "DownloadEngine.h" #include "Request.h" #include "HttpRequestCommand.h" #include "Util.h" #include "message.h" HttpDownloadCommand::HttpDownloadCommand(int cuid, const RequestHandle req, RequestGroup* requestGroup, DownloadEngine* e, const SocketHandle& socket) :DownloadCommand(cuid, req, requestGroup, e, socket) {} HttpDownloadCommand::~HttpDownloadCommand() {} bool HttpDownloadCommand::prepareForNextSegment() { if(!_requestGroup->downloadFinished()) { if(req->isKeepAlive()) { Command* command = new HttpRequestCommand(cuid, req, _requestGroup, e, socket); e->commands.push_back(command); return true; } else { return DownloadCommand::prepareForNextSegment(); } } else { return DownloadCommand::prepareForNextSegment(); } }