fix invariant check issue with a paused session (#750)

fix invariant check issue with a paused session
This commit is contained in:
Arvid Norberg 2016-05-22 22:58:11 -04:00
parent f6b18c7097
commit 62fb7209ef
2 changed files with 9 additions and 2 deletions

View File

@ -9986,7 +9986,11 @@ namespace libtorrent
void torrent::do_resume()
{
TORRENT_ASSERT(is_single_thread());
if (is_paused()) return;
if (is_paused())
{
update_want_tick();
return;
}
#ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin()

View File

@ -48,6 +48,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/bencode.hpp"
#include "libtorrent/torrent_info.hpp"
#include <fstream>
using namespace libtorrent;
namespace lt = libtorrent;
@ -137,7 +139,8 @@ TORRENT_TEST(paused_session)
s.pause();
lt::add_torrent_params ps;
ps.info_hash.assign("abababababababababab");
std::ofstream file("temporary");
ps.ti = ::create_torrent(&file, "temporary", 16 * 1024, 13, false);
ps.flags = lt::add_torrent_params::flag_paused;
ps.save_path = ".";