merged create_torrent fix from RC_0_16

This commit is contained in:
Arvid Norberg 2013-11-07 05:17:09 +00:00
parent 3c5ec23480
commit 4ac6264487
2 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@
* fix uTP edge case where udp socket buffer fills up * fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP * fix nagle implementation in uTP
* add some error handling to set_piece_hashes()
* fix completed-on timestamp to not be clobbered on each startup * fix completed-on timestamp to not be clobbered on each startup
* fix deadlock caused by some UDP tracker failures * fix deadlock caused by some UDP tracker failures
* fix potential integer overflow issue in timers on windows * fix potential integer overflow issue in timers on windows

View File

@ -200,6 +200,12 @@ namespace libtorrent
std::string const& path = p; std::string const& path = p;
#endif #endif
if (t.files().num_files() == 0)
{
ec = error_code(errors::no_files_in_torrent, get_libtorrent_category());
return;
}
boost::scoped_ptr<storage_interface> st( boost::scoped_ptr<storage_interface> st(
default_storage_constructor(const_cast<file_storage&>(t.files()), 0, path, fp default_storage_constructor(const_cast<file_storage&>(t.files()), 0, path, fp
, std::vector<boost::uint8_t>())); , std::vector<boost::uint8_t>()));