support multiple trackers in magnet links
This commit is contained in:
@@ -473,7 +473,7 @@ namespace libtorrent
|
||||
}
|
||||
|
||||
std::string url_has_argument(
|
||||
std::string const& url, std::string argument)
|
||||
std::string const& url, std::string argument, int* out_pos)
|
||||
{
|
||||
size_t i = url.find('?');
|
||||
if (i == std::string::npos) return std::string();
|
||||
@@ -484,12 +484,14 @@ namespace libtorrent
|
||||
if (url.compare(i, argument.size(), argument) == 0)
|
||||
{
|
||||
size_t pos = i + argument.size();
|
||||
if (out_pos) *out_pos = pos;
|
||||
return url.substr(pos, url.find('&', pos) - pos);
|
||||
}
|
||||
argument.insert(0, "&");
|
||||
i = url.find(argument, i);
|
||||
if (i == std::string::npos) return std::string();
|
||||
size_t pos = i + argument.size();
|
||||
if (out_pos) *out_pos = pos;
|
||||
return url.substr(pos, url.find('&', pos) - pos);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user