/* */ #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" namespace aria2 { AbstractProxyResponseCommand::AbstractProxyResponseCommand (int cuid, const RequestHandle& 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() { HttpResponseHandle httpResponse = httpConnection->receiveResponse(); if(httpResponse.isNull()) { // the server has not responded our request yet. e->commands.push_back(this); return false; } if(httpResponse->getResponseStatus() != HttpHeader::S200) { throw DL_RETRY_EX(EX_PROXY_CONNECTION_FAILED); } e->commands.push_back(getNextCommand()); return true; } } // namespace aria2