mirror of https://github.com/aria2/aria2
2009-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that trackers in BitTorrent Magnet URI are not inherited to generated RequestGroup. * src/UTMetadataPostDownloadHandler.cc * test/UTMetadataPostDownloadHandlerTest.ccpull/1/head
parent
656cbd16a0
commit
3fa6ce55f4
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2009-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Fixed the bug that trackers in BitTorrent Magnet URI are not
|
||||||
|
inherited to generated RequestGroup.
|
||||||
|
* src/UTMetadataPostDownloadHandler.cc
|
||||||
|
* test/UTMetadataPostDownloadHandlerTest.cc
|
||||||
|
|
||||||
|
2009-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Prepended "[METADATA]" before dn.
|
||||||
|
* src/bittorrent_helper.cc
|
||||||
|
* test/BittorrentHelperTest.cc
|
||||||
|
|
||||||
2009-11-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-11-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Rewritten Magnet URI parser.
|
Rewritten Magnet URI parser.
|
||||||
|
|
|
@ -92,7 +92,8 @@ void UTMetadataPostDownloadHandler::getNextRequestGroups
|
||||||
newAttrs[bittorrent::INFO_HASH].s()) {
|
newAttrs[bittorrent::INFO_HASH].s()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!newAttrs.containsKey(bittorrent::ANNOUNCE_LIST)) {
|
assert(newAttrs[bittorrent::ANNOUNCE_LIST].isList());
|
||||||
|
if(newAttrs[bittorrent::ANNOUNCE_LIST].size() == 0) {
|
||||||
newAttrs[bittorrent::ANNOUNCE_LIST] =
|
newAttrs[bittorrent::ANNOUNCE_LIST] =
|
||||||
attrs[bittorrent::ANNOUNCE_LIST];
|
attrs[bittorrent::ANNOUNCE_LIST];
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@ void UTMetadataPostDownloadHandlerTest::testGetNextRequestGroups()
|
||||||
BDE attrs = BDE::dict();
|
BDE attrs = BDE::dict();
|
||||||
attrs[bittorrent::INFO_HASH] = std::string(&infoHash[0], &infoHash[20]);
|
attrs[bittorrent::INFO_HASH] = std::string(&infoHash[0], &infoHash[20]);
|
||||||
BDE announceList = BDE::list();
|
BDE announceList = BDE::list();
|
||||||
|
announceList << BDE::list();
|
||||||
|
announceList[0] << std::string("http://tracker");
|
||||||
attrs[bittorrent::ANNOUNCE_LIST] = announceList;
|
attrs[bittorrent::ANNOUNCE_LIST] = announceList;
|
||||||
_dctx->setAttribute(bittorrent::BITTORRENT, attrs);
|
_dctx->setAttribute(bittorrent::BITTORRENT, attrs);
|
||||||
_requestGroup->setDiskWriterFactory
|
_requestGroup->setDiskWriterFactory
|
||||||
|
@ -93,6 +95,9 @@ void UTMetadataPostDownloadHandlerTest::testGetNextRequestGroups()
|
||||||
CPPUNIT_ASSERT_EQUAL(util::toHex(attrs[bittorrent::INFO_HASH].s()),
|
CPPUNIT_ASSERT_EQUAL(util::toHex(attrs[bittorrent::INFO_HASH].s()),
|
||||||
util::toHex(newAttrs[bittorrent::INFO_HASH].s()));
|
util::toHex(newAttrs[bittorrent::INFO_HASH].s()));
|
||||||
CPPUNIT_ASSERT(newAttrs.containsKey(bittorrent::ANNOUNCE_LIST));
|
CPPUNIT_ASSERT(newAttrs.containsKey(bittorrent::ANNOUNCE_LIST));
|
||||||
|
CPPUNIT_ASSERT_EQUAL((size_t)1, newAttrs[bittorrent::ANNOUNCE_LIST].size());
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("http://tracker"),
|
||||||
|
newAttrs[bittorrent::ANNOUNCE_LIST][0][0].s());
|
||||||
CPPUNIT_ASSERT_EQUAL(_option->get("Hello"),
|
CPPUNIT_ASSERT_EQUAL(_option->get("Hello"),
|
||||||
newRg->getOption()->get("Hello"));
|
newRg->getOption()->get("Hello"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue