From 00efc31bf6a3221ad4ff86c95e786f713ed3d815 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 30 Dec 2010 03:46:11 +0000 Subject: [PATCH] various smaller fixes --- src/disk_io_thread.cpp | 1 + src/policy.cpp | 1 + test/test_primitives.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) 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()