correctly URL encode the IPv6 argument to trackers

This commit is contained in:
arvidn 2017-03-09 19:09:10 -05:00 committed by Arvid Norberg
parent dec8c853e3
commit 08c05b9693
3 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,4 @@
* correctly URL encode the IPv6 argument to trackers
* fix default file pool size on windows
* fix bug where settings_pack::file_pool_size setting was not being honored
* add feature to periodically close files (to make windows clear disk cache)

View File

@ -744,6 +744,9 @@ TORRENT_TEST(tracker_ipv6_argument)
std::string::size_type pos = req.find("&ipv6=");
TEST_CHECK(pos != std::string::npos);
got_ipv6 = pos != std::string::npos;
// make sure the IPv6 argument is url encoded
TEST_CHECK(req.substr(pos + 6, req.find_first_of(pos + 6, '&'))
== "ffff%3a%3a1337");
return sim::send_response(200, "OK", 11) + "d5:peers0:e";
}
, [](torrent_handle h) {}

View File

@ -194,7 +194,7 @@ namespace libtorrent
if (!err)
{
url += "&ipv6=";
url += ip;
url += escape_string(ip.c_str(), ip.size());
}
}
#endif