diff --git a/ChangeLog b/ChangeLog index 19a630237..e3c612d4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * fixed bug where setting upload slots to -1 would not mean infinite * extend the UDP tracker protocol to include the request string from the tracker URL * fix mingw build for linux crosscompiler diff --git a/src/session_impl.cpp b/src/session_impl.cpp index ffba48dbe..cdd088547 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2071,6 +2071,8 @@ namespace aux { else if (s.choking_algorithm == session_settings::auto_expand_choker && m_allowed_upload_slots < m_settings.unchoke_slots_limit) m_allowed_upload_slots = m_settings.unchoke_slots_limit; + if (m_allowed_upload_slots < 0) + m_allowed_upload_slots = (std::numeric_limits::max)(); // replace all occurances of '\n' with ' '. std::string::iterator i = m_settings.user_agent.begin(); @@ -6062,6 +6064,10 @@ namespace aux { { TORRENT_ASSERT(is_network_thread()); + if (m_settings.unchoke_slots_limit < 0 + && m_settings.choking_algorithm == session_settings::fixed_slots_choker) + TORRENT_ASSERT(m_allowed_upload_slots == (std::numeric_limits::max)()); + int num_checking = 0; int num_queued_for_checking = 0; for (check_queue_t::const_iterator i = m_queued_for_checking.begin()