summaryrefslogtreecommitdiff
path: root/src/HttpRequestConnectChain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/HttpRequestConnectChain.h')
-rw-r--r--src/HttpRequestConnectChain.h8
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);