From 4ac626448774fc5deebd6f63eb7e4864cadca059 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 7 Nov 2013 05:17:09 +0000 Subject: [PATCH] merged create_torrent fix from RC_0_16 --- ChangeLog | 1 + src/create_torrent.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5b232bee1..85cc772e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ * fix uTP edge case where udp socket buffer fills up * 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 deadlock caused by some UDP tracker failures * fix potential integer overflow issue in timers on windows diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index f25b57043..4d9608325 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -200,6 +200,12 @@ namespace libtorrent std::string const& path = p; #endif + if (t.files().num_files() == 0) + { + ec = error_code(errors::no_files_in_torrent, get_libtorrent_category()); + return; + } + boost::scoped_ptr st( default_storage_constructor(const_cast(t.files()), 0, path, fp , std::vector()));