/* */ #include "AbstractProxyResponseCommand.h" #include "HttpConnection.h" #include "Request.h" #include "Segment.h" #include "RequestGroup.h" #include "DownloadEngine.h" #include "HttpRequest.h" #include "HttpResponse.h" #include "HttpRequestCommand.h" #include "Socket.h" #include "DlRetryEx.h" #include "message.h" #include "HttpHeader.h" #include "DownloadContext.h" #include "RequestGroupMan.h" #include "FileAllocationEntry.h" #include "CheckIntegrityEntry.h" #include "ServerStatMan.h" namespace aria2 { AbstractProxyResponseCommand::AbstractProxyResponseCommand (cuid_t cuid, const SharedHandle& req, const SharedHandle& fileEntry, RequestGroup* requestGroup, const HttpConnectionHandle& httpConnection, DownloadEngine* e, const SocketHandle& s) :AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), httpConnection_(httpConnection) {} AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {} bool AbstractProxyResponseCommand::executeInternal() { SharedHandle httpResponse = httpConnection_->receiveResponse(); if(httpResponse.isNull()) { // the server has not responded our request yet. getDownloadEngine()->addCommand(this); return false; } if(httpResponse->getResponseStatus() != HttpHeader::S200) { throw DL_RETRY_EX(EX_PROXY_CONNECTION_FAILED); } getDownloadEngine()->addCommand(getNextCommand()); return true; } } // namespace aria2