2009-12-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Show info hash in Magnet URI in upper case letters in -S output.
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-12-18 06:32:14 +00:00
parent 4171e7cadf
commit 0734dfa770
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-12-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Show info hash in Magnet URI in upper case letters in -S output.
* src/bittorrent_helper.cc
* test/BittorrentHelperTest.cc
2009-12-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2009-12-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed old useless comment Removed old useless comment

View File

@ -941,7 +941,7 @@ std::string torrent2Magnet(const BDE& attrs)
std::string uri = "magnet:?"; std::string uri = "magnet:?";
if(attrs.containsKey(INFO_HASH)) { if(attrs.containsKey(INFO_HASH)) {
uri += "xt=urn:btih:"; uri += "xt=urn:btih:";
uri += util::toHex(attrs[INFO_HASH].s()); uri += util::toUpper(util::toHex(attrs[INFO_HASH].s()));
} else { } else {
return A2STR::NIL; return A2STR::NIL;
} }

View File

@ -763,7 +763,7 @@ void BittorrentHelperTest::testTorrent2Magnet()
load("test.torrent", dctx); load("test.torrent", dctx);
CPPUNIT_ASSERT_EQUAL CPPUNIT_ASSERT_EQUAL
(std::string("magnet:?xt=urn:btih:248d0a1cd08284299de78d5c1ed359bb46717d8c" (std::string("magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C"
"&dn=aria2-test" "&dn=aria2-test"
"&tr=http%3A%2F%2Ftracker1" "&tr=http%3A%2F%2Ftracker1"
"&tr=http%3A%2F%2Ftracker2" "&tr=http%3A%2F%2Ftracker2"