/* */ #ifndef HTTP_REQUEST_CONNECT_CHAIN_H #define HTTP_REQUEST_CONNECT_CHAIN_H #include "ControlChain.h" #include "ConnectCommand.h" #include "DownloadEngine.h" #include "SocketRecvBuffer.h" #include "HttpConnection.h" #include "HttpRequestCommand.h" namespace aria2 { struct HttpRequestConnectChain : public ControlChain { HttpRequestConnectChain() {} virtual ~HttpRequestConnectChain() {} virtual int run(ConnectCommand* t, DownloadEngine* e) { SharedHandle socketRecvBuffer (new SocketRecvBuffer(t->getSocket())); SharedHandle httpConnection (new HttpConnection(t->getCuid(), t->getSocket(), socketRecvBuffer)); HttpRequestCommand* c = new HttpRequestCommand(t->getCuid(), t->getRequest(), t->getFileEntry(), t->getRequestGroup(), httpConnection, e, t->getSocket()); c->setProxyRequest(t->getProxyRequest()); c->setStatus(Command::STATUS_ONESHOT_REALTIME); e->setNoWait(true); e->addCommand(c); return 0; } }; } // namespace aria2 #endif // HTTP_REQUEST_CONNECT_CHAIN_H