/* */ #include "AbstractProxyRequestCommand.h" #include "DownloadEngine.h" #include "RequestGroup.h" #include "Request.h" #include "HttpConnection.h" #include "HttpRequest.h" #include "Segment.h" #include "Option.h" #include "prefs.h" #include "Socket.h" #include "CookieStorage.h" namespace aria2 { AbstractProxyRequestCommand::AbstractProxyRequestCommand(int cuid, const RequestHandle& req, RequestGroup* requestGroup, DownloadEngine* e, const SocketHandle& s) :AbstractCommand(cuid, req, requestGroup, e, s) { disableReadCheckSocket(); setWriteCheckSocket(socket); } AbstractProxyRequestCommand::~AbstractProxyRequestCommand() {} bool AbstractProxyRequestCommand::executeInternal() { socket->setBlockingMode(); HttpRequestHandle httpRequest(new HttpRequest()); httpRequest->setUserAgent(e->option->get(PREF_USER_AGENT)); httpRequest->setRequest(req); httpRequest->configure(e->option); httpConnection.reset(new HttpConnection(cuid, socket, e->option)); httpConnection->sendProxyRequest(httpRequest); e->commands.push_back(getNextCommand()); return true; } } // namespace aria2