diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 2382b6509..a2ed35dff 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -378,6 +378,7 @@ namespace libtorrent disk_io_job j; m_waiting_to_shutdown = true; j.action = disk_io_job::abort_thread; + j.start_time = time_now_hires(); m_jobs.insert(m_jobs.begin(), j); m_signal.signal(l); } diff --git a/src/policy.cpp b/src/policy.cpp index c7e1c31a8..338c62f8b 100644 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -744,6 +744,7 @@ namespace libtorrent if (found) { i = *iter; + TORRENT_ASSERT(i->connection != &c); if (i->banned) { diff --git a/test/test_primitives.cpp b/test/test_primitives.cpp index 6ae3d2a16..f0a6cc133 100644 --- a/test/test_primitives.cpp +++ b/test/test_primitives.cpp @@ -383,7 +383,7 @@ TORRENT_EXPORT void find_control_url(int type, char const* string, parse_state& address rand_v4() { - return address_v4(rand() << 16 | rand()); + return address_v4((rand() << 16 | rand()) & 0xffffffff); } int test_main()