mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
DownloadContext::attrs_ now holds std::unique_ptr
DownloadContext::getAttribute() returns a raw pointer.
This commit is contained in:
parent
1a299c4d7c
commit
bef6236da8
29 changed files with 146 additions and 157 deletions
|
@ -73,7 +73,6 @@ void UTMetadataDataExtensionMessageTest::testDoReceivedAction()
|
|||
std::shared_ptr<UTMetadataRequestTracker> tracker
|
||||
(new UTMetadataRequestTracker());
|
||||
std::shared_ptr<DownloadContext> dctx(new DownloadContext());
|
||||
std::shared_ptr<TorrentAttribute> attrs(new TorrentAttribute());
|
||||
|
||||
std::string piece0 = std::string(METADATA_PIECE_SIZE, '0');
|
||||
std::string piece1 = std::string(METADATA_PIECE_SIZE, '1');
|
||||
|
@ -83,9 +82,11 @@ void UTMetadataDataExtensionMessageTest::testDoReceivedAction()
|
|||
message_digest::digest(infoHash, INFO_HASH_LENGTH,
|
||||
MessageDigest::sha1(),
|
||||
metadata.data(), metadata.size());
|
||||
attrs->infoHash = std::string(&infoHash[0], &infoHash[20]);
|
||||
dctx->setAttribute(CTX_ATTR_BT, attrs);
|
||||
|
||||
{
|
||||
auto attrs = make_unique<TorrentAttribute>();
|
||||
attrs->infoHash = std::string(&infoHash[0], &infoHash[20]);
|
||||
dctx->setAttribute(CTX_ATTR_BT, std::move(attrs));
|
||||
}
|
||||
UTMetadataDataExtensionMessage m(1);
|
||||
m.setPieceStorage(pieceStorage);
|
||||
m.setUTMetadataRequestTracker(tracker.get());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue