From 2b72a7321ac9131b4eedc6370cf24e8180c5e6af Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Wed, 11 Oct 2017 14:10:40 -0700 Subject: [PATCH 1/5] send one last state update when a paused torrent's rates reach zero (#2436) --- ChangeLog | 2 ++ src/torrent.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70329b552..3f4e5d323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,8 @@ * don't attempt to create empty files on startup, if they already exist * fix force-recheck issue (new files would not be picked up) * fix inconsistency in file_priorities and override_resume_data behavior + * fix paused torrents not generating a state update when their ul/dl rate + transitions to zero 1.1.4 release diff --git a/src/torrent.cpp b/src/torrent.cpp index 63f8bec49..2319557f7 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -10402,11 +10402,13 @@ namespace { if (is_paused() && !m_graceful_pause_mode) { // let the stats fade out to 0 - m_stat.second_tick(tick_interval_ms); - // if the rate is 0, there's no update because of network transfers + // check the rate before ticking the stats so that the last update is sent + // with the rate equal to zero if (m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0) state_updated(); - else + m_stat.second_tick(tick_interval_ms); + // if the rate is 0, there's no update because of network transfers + if (!(m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0)) update_want_tick(); return; From 4556fe5566af5b7f331d922f6476e528777faa3d Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 13 Oct 2017 16:27:21 +0200 Subject: [PATCH 2/5] fix outdated comment --- include/libtorrent/settings_pack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libtorrent/settings_pack.hpp b/include/libtorrent/settings_pack.hpp index 4632ae62d..675157c69 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -900,7 +900,7 @@ namespace libtorrent // // * ``fixed_slots_choker`` is the traditional choker with a fixed // number of unchoke slots (as specified by - // ``session::set_max_uploads()``). + // ``settings_pack::unchoke_slots_limit``). // // * ``rate_based_choker`` opens up unchoke slots based on the upload // rate achieved to peers. The more slots that are opened, the From e2a65adbc0cc2dee6979e800b722cdd44bec983a Mon Sep 17 00:00:00 2001 From: silver Date: Thu, 12 Oct 2017 21:17:23 +0200 Subject: [PATCH 3/5] added dbghelp lib and bigobj to cmake for msvc --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ee55f61..9f586d14f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,12 +268,16 @@ target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_I if (WIN32) target_link_libraries(torrent-rasterbar wsock32 ws2_32 Iphlpapi) + target_link_libraries(torrent-rasterbar debug dbghelp) add_definitions(-D_WIN32_WINNT=0x0600) # prevent winsock1 to be included add_definitions(-DWIN32_LEAN_AND_MEAN) if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # multicore compilation + # for multicore compilation + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + # increase the number of sections for obj files + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") endif() endif() From e67cf0a05570b8d58277ec074b30fe18d811281e Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 14 Oct 2017 13:32:21 +0200 Subject: [PATCH 4/5] add missing files to CMakeLists.txt for test suite --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f586d14f..7548e8e80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,7 +379,7 @@ if(build_tests) add_library(test_common OBJECT test/main.cpp test/test.cpp test/setup_transfer.cpp test/dht_server.cpp test/udp_tracker.cpp test/peer_server.cpp test/web_seed_suite.cpp test/swarm_suite.cpp - test/test_utils.cpp) + test/test_utils.cpp test/make_torrent.cpp test/settings.cpp) enable_testing() foreach(s ${tests}) From 62141036192954157469324cb2411e728c3f0851 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 14 Oct 2017 13:54:43 +0200 Subject: [PATCH 5/5] fix documentation typo --- include/libtorrent/torrent_info.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libtorrent/torrent_info.hpp b/include/libtorrent/torrent_info.hpp index 510913e8e..0d8c3cae4 100644 --- a/include/libtorrent/torrent_info.hpp +++ b/include/libtorrent/torrent_info.hpp @@ -504,7 +504,7 @@ namespace libtorrent // .torrent file. If the specified key cannot be found, it returns NULL. bdecode_node info(char const* key) const; - // swap the content of this and ``ti```. + // swap the content of this and ``ti``. void swap(torrent_info& ti); // ``metadata()`` returns a the raw info section of the torrent file. The size