/* */ #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 (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) { // the server has not responded our request yet. getDownloadEngine()->addCommand(this); return false; } if(httpResponse->getStatusCode() != 200) { throw DL_RETRY_EX(EX_PROXY_CONNECTION_FAILED); } getDownloadEngine()->addCommand(getNextCommand()); return true; } } // namespace aria2