diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 00:17:44 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 15:56:08 +0900 |
| commit | 6b397c812520016f7b2b22544f51bfddbcca8dfe (patch) | |
| tree | 6dcf656fb19da47833324111efcee62c66809365 /src/HttpResponseCommand.cc | |
| parent | c9e58779e1a30b32ea2f86e686211d901aca19f0 (diff) | |
Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntry
Diffstat (limited to 'src/HttpResponseCommand.cc')
| -rw-r--r-- | src/HttpResponseCommand.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index b6027f24..4b232d42 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -377,7 +377,7 @@ bool HttpResponseCommand::handleDefaultEncoding getFileEntry()->poolRequest(getRequest()); } - prepareForNextAction(checkEntry); + prepareForNextAction(std::move(checkEntry)); if(getRequest()->getMethod() == Request::METHOD_HEAD) { poolConnection(); @@ -421,11 +421,11 @@ bool HttpResponseCommand::handleOtherEncoding // See also FtpNegotiationCommand::onFileSizeDetermined() if(getDownloadContext()->isChecksumVerificationNeeded()) { A2_LOG_DEBUG("Zero length file exists. Verify checksum."); - std::shared_ptr<ChecksumCheckIntegrityEntry> entry - (new ChecksumCheckIntegrityEntry(getRequestGroup())); + auto entry = make_unique<ChecksumCheckIntegrityEntry> + (getRequestGroup()); entry->initValidator(); getPieceStorage()->getDiskAdaptor()->openExistingFile(); - getDownloadEngine()->getCheckIntegrityMan()->pushEntry(entry); + getDownloadEngine()->getCheckIntegrityMan()->pushEntry(std::move(entry)); } else #endif // ENABLE_MESSAGE_DIGEST { @@ -455,10 +455,10 @@ bool HttpResponseCommand::handleOtherEncoding #ifdef ENABLE_MESSAGE_DIGEST if(getDownloadContext()->isChecksumVerificationNeeded()) { A2_LOG_DEBUG("Verify checksum for zero-length file"); - auto entry = std::make_shared<ChecksumCheckIntegrityEntry> + auto entry = make_unique<ChecksumCheckIntegrityEntry> (getRequestGroup()); entry->initValidator(); - getDownloadEngine()->getCheckIntegrityMan()->pushEntry(entry); + getDownloadEngine()->getCheckIntegrityMan()->pushEntry(std::move(entry)); } else #endif // ENABLE_MESSAGE_DIGEST { |
