forked from premiere/premiere-libtorrent
handle web seed urls that don't end with / when they should
This commit is contained in:
parent
a961e253ef
commit
0aa477ce54
|
@ -162,9 +162,14 @@ namespace libtorrent
|
||||||
|
|
||||||
TORRENT_ASSERT(t->valid_metadata());
|
TORRENT_ASSERT(t->valid_metadata());
|
||||||
|
|
||||||
bool single_file_request = false;
|
bool single_file_request = t->torrent_file().num_files() == 1;
|
||||||
if (!m_path.empty() && m_path[m_path.size() - 1] != '/')
|
|
||||||
single_file_request = true;
|
// handle incorrect .torrent files which are multi-file
|
||||||
|
// but have web seeds not ending with a slash
|
||||||
|
if (!single_file_request && (m_path.empty() || m_path[m_path.size() - 1] != '/'))
|
||||||
|
{
|
||||||
|
m_path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
torrent_info const& info = t->torrent_file();
|
torrent_info const& info = t->torrent_file();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue