diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 21:55:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 21:55:52 +0900 |
| commit | fa9f3fb5a3c8912a0a6880ffba9c72f4424ea044 (patch) | |
| tree | deb0b47b085a3a689bf386409734bfd3f72f57d2 /src/HttpDownloadCommand.cc | |
| parent | bb5b7eeedb3ce7396007818cbab4f5f5660997a5 (diff) | |
Wrap Command object in std::unique_ptr
Diffstat (limited to 'src/HttpDownloadCommand.cc')
| -rw-r--r-- | src/HttpDownloadCommand.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/HttpDownloadCommand.cc b/src/HttpDownloadCommand.cc index 3436bb58..93cca2d0 100644 --- a/src/HttpDownloadCommand.cc +++ b/src/HttpDownloadCommand.cc @@ -75,16 +75,16 @@ HttpDownloadCommand::~HttpDownloadCommand() {} bool HttpDownloadCommand::prepareForNextSegment() { bool downloadFinished = getRequestGroup()->downloadFinished(); if(getRequest()->isPipeliningEnabled() && !downloadFinished) { - HttpRequestCommand* command = - new HttpRequestCommand(getCuid(), getRequest(), getFileEntry(), - getRequestGroup(), httpConnection_, - getDownloadEngine(), getSocket()); + auto command = make_unique<HttpRequestCommand> + (getCuid(), getRequest(), getFileEntry(), + getRequestGroup(), httpConnection_, + getDownloadEngine(), getSocket()); // Set proxy request here. aria2 sends the HTTP request specialized for // proxy. if(resolveProxyMethod(getRequest()->getProtocol()) == V_GET) { command->setProxyRequest(createProxyRequest()); } - getDownloadEngine()->addCommand(command); + getDownloadEngine()->addCommand(std::move(command)); return true; } else { const std::string& streamFilterName = getStreamFilter()->getName(); |
