web seeding fix for multi file torrents with a single file

This commit is contained in:
Arvid Norberg 2011-11-25 21:05:39 +00:00
parent faf11fc27d
commit ce90e17e2b
1 changed files with 2 additions and 2 deletions

View File

@ -152,8 +152,8 @@ namespace libtorrent
{
// handle .torrent files that don't include the filename in the url
if (m_path.empty()) m_path += "/" + t->torrent_file().name();
else if (m_path[m_path.size() - 1] == '/') m_path += t->torrent_file().name();
if (!m_url.empty() && m_url[m_url.size() - 1] == '/') m_url += t->torrent_file().name();
else if (m_path[m_path.size() - 1] == '/') m_path += t->torrent_file().files().at(0).path;
if (!m_url.empty() && m_url[m_url.size() - 1] == '/') m_url += t->torrent_file().files().at(0).path;
}
torrent_info const& info = t->torrent_file();