/* */ #include "AbstractProxyResponseCommand.h" #include "HttpRequestCommand.h" #include "DlRetryEx.h" #include "message.h" AbstractProxyResponseCommand::AbstractProxyResponseCommand(int cuid, const RequestHandle& req, const HttpConnectionHandle& httpConnection, DownloadEngine* e, const SocketHandle& s) :AbstractCommand(cuid, req, 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->getStatus() != 200) { throw new DlRetryEx(EX_PROXY_CONNECTION_FAILED); } e->commands.push_back(getNextCommand()); return true; }