From 499edabf9feb8ad17a324528f864eab190baa94b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 19 Jul 2014 22:33:45 +0000 Subject: [PATCH] a bit more cleaning up of m_ses uses in peer_connection --- src/peer_connection.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 0e10a1d4c..1a3ae6727 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -869,7 +869,6 @@ namespace libtorrent #if TORRENT_USE_ASSERTS m_destructed = true; #endif - TORRENT_ASSERT(m_ses.is_single_thread()); #if TORRENT_USE_ASSERTS m_in_use = 0; @@ -1104,7 +1103,7 @@ namespace libtorrent // we don't know what rate we can get from this peer. Instead of assuming // the lowest possible rate, assume the average. - int peers_with_requests = m_ses.stats_counters()[counters::num_peers_down_requests]; + int peers_with_requests = stats_counters()[counters::num_peers_down_requests]; // avoid division by 0 if (peers_with_requests == 0) peers_with_requests = 1; @@ -2898,7 +2897,6 @@ namespace libtorrent { torrent_ref_holder h(t.get(), "async_write"); if (t) t->dec_refcount("async_write"); - TORRENT_ASSERT(m_ses.is_single_thread()); #ifdef TORRENT_VERBOSE_LOGGING peer_log("*** FILE ASYNC WRITE COMPLETE [ ret: %d | piece: %d | s: %x | l: %x | e: %s ]" @@ -5040,7 +5038,6 @@ namespace libtorrent // checked, while in seed-mode void peer_connection::on_seed_mode_hashed(disk_io_job const* j) { - TORRENT_ASSERT(m_ses.is_single_thread()); INVARIANT_CHECK; boost::shared_ptr t = m_torrent.lock(); @@ -5097,8 +5094,6 @@ namespace libtorrent // 0: success, piece passed hash check // -1: disk failure - TORRENT_ASSERT(m_ses.is_single_thread()); - #ifdef TORRENT_VERBOSE_LOGGING peer_log("*** FILE ASYNC READ COMPLETE [ ret: %d | piece: %d | s: %x | l: %x" " | b: %p | c: %s | e: %s ]" @@ -5808,8 +5803,6 @@ namespace libtorrent // function. TORRENT_ASSERT(m_channel_state[download_channel] & peer_info::bw_network); - TORRENT_ASSERT(m_ses.is_single_thread()); - // nb is short for null_buffers. In this mode we don't actually // allocate a receive buffer up-front, but get notified when // we can read from the socket, and then determine how much there @@ -5920,8 +5913,6 @@ namespace libtorrent // function. TORRENT_ASSERT(m_channel_state[download_channel] & peer_info::bw_network); - TORRENT_ASSERT(m_ses.is_single_thread()); - receive_data_impl(error, bytes_transferred, 10); } @@ -6137,7 +6128,6 @@ namespace libtorrent } #endif - TORRENT_ASSERT(m_ses.is_single_thread()); #if TORRENT_USE_ASSERTS // in case we disconnect here, we need to // keep the connection alive until the @@ -6227,8 +6217,6 @@ namespace libtorrent #endif ptime completed = time_now_hires(); - TORRENT_ASSERT(m_ses.is_single_thread()); - INVARIANT_CHECK; m_rtt = boost::uint16_t(total_milliseconds(completed - m_connect)); @@ -6374,7 +6362,6 @@ namespace libtorrent { m_counters.inc_stats_counter(counters::on_write_counter); m_ses.sent_buffer(bytes_transferred); - TORRENT_ASSERT(m_ses.is_single_thread()); #if TORRENT_USE_ASSERTS TORRENT_ASSERT(m_socket_is_writing);