diff options
| author | kwkam <kwkam@users.noreply.github.com> | 2017-11-05 00:56:08 +0800 |
|---|---|---|
| committer | kwkam <kwkam@users.noreply.github.com> | 2017-11-05 00:56:08 +0800 |
| commit | 89be2fc649d6a50a62bcac79d2199e958be5ff26 (patch) | |
| tree | 0540cab3fadbaf1488742c938591b0595a81e306 /src/HttpRequestConnectChain.h | |
| parent | aafa368885fb6b725e5e19b0b20f08a4cf4caa8b (diff) | |
replace some lines with make_shared
Diffstat (limited to 'src/HttpRequestConnectChain.h')
| -rw-r--r-- | src/HttpRequestConnectChain.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/HttpRequestConnectChain.h b/src/HttpRequestConnectChain.h index 0a5cc9d9..dd3ccaac 100644 --- a/src/HttpRequestConnectChain.h +++ b/src/HttpRequestConnectChain.h @@ -49,13 +49,11 @@ struct HttpRequestConnectChain : public ControlChain<ConnectCommand*> { virtual ~HttpRequestConnectChain() {} virtual int run(ConnectCommand* t, DownloadEngine* e) CXX11_OVERRIDE { - std::shared_ptr<SocketRecvBuffer> socketRecvBuffer( - new SocketRecvBuffer(t->getSocket())); - std::shared_ptr<HttpConnection> httpConnection( - new HttpConnection(t->getCuid(), t->getSocket(), socketRecvBuffer)); + auto b = std::make_shared<SocketRecvBuffer>(t->getSocket()); + auto k = std::make_shared<HttpConnection>(t->getCuid(), t->getSocket(), b); auto c = make_unique<HttpRequestCommand>( t->getCuid(), t->getRequest(), t->getFileEntry(), t->getRequestGroup(), - httpConnection, e, t->getSocket()); + k, e, t->getSocket()); c->setProxyRequest(t->getProxyRequest()); c->setStatus(Command::STATUS_ONESHOT_REALTIME); e->setNoWait(true); |
