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