diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 71210cdcb..9c4c04e6b 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2482,7 +2482,7 @@ namespace aux { // way of limiting it int limit = m_connections.size(); - do + while (m_next_disk_peer != m_connections.end() && limit > 0 && can_write_to_disk()) { --limit; peer_connection* p = m_next_disk_peer->get(); @@ -2491,8 +2491,8 @@ namespace aux { if (p->m_channel_state[peer_connection::download_channel] != peer_info::bw_disk) continue; p->on_disk(); + } - } while (m_next_disk_peer != m_connections.end() && limit > 0 && can_write_to_disk()); } // used to cache the current time