diff --git a/doc/log_stats.plot b/doc/log_stats.plot index 78429602..9f10f735 100644 --- a/doc/log_stats.plot +++ b/doc/log_stats.plot @@ -1,3 +1,5 @@ +#/bin/bash +gnuplot << EOF # $system.time_seconds= # # $throttle.global_up.rate= @@ -9,7 +11,7 @@ # $throttle.unchoked_downloads= # $pieces.memory.current= # -# schedule = log_stats,5,10,"execute={log_rtorrent.sh,/Users/rakshasa/tmp/rtorrent.log,$system.time_seconds=,$throttle.global_up.rate=,$throttle.global_up.total=,$throttle.global_down.rate=,$throttle.global_down.total=,$throttle.unchoked_uploads=,$throttle.unchoked_downloads=,$pieces.memory.current=}" +# schedule = log_stats,5,10,"execute={log_rtorrent.sh,\"$cat=/foo/bar.,$system.pid=\",$system.time_seconds=,$throttle.global_up.rate=,$throttle.global_up.total=,$throttle.global_down.rate=,$throttle.global_down.total=,$throttle.unchoked_uploads=,$throttle.unchoked_downloads=,$pieces.memory.current=}" set terminal png @@ -20,18 +22,19 @@ set format x "%H:%M" #set multiplot -plot "./rtorrent.log" using 1:2 smooth bezier with lines title 'Upload rate',\ - "./rtorrent.log" using 1:4 smooth bezier with lines title 'Download rate',\ - "./rtorrent.log" using 1:6 smooth bezier with lines title 'Upload unchoked' axis x1y2,\ - "./rtorrent.log" using 1:7 smooth bezier with lines title 'Download unchoked' axis x1y2 +plot "$1" using 1:2 smooth bezier with lines title 'Upload rate',\ + "$1" using 1:4 smooth bezier with lines title 'Download rate',\ + "$1" using 1:6 smooth bezier with lines title 'Upload unchoked' axis x1y2,\ + "$1" using 1:7 smooth bezier with lines title 'Download unchoked' axis x1y2 set output "output_2.png" -plot "./rtorrent.log" using 1:8 smooth bezier with lines title 'Memory usage' axis x1y1 +plot "$1" using 1:8 smooth bezier with lines title 'Memory usage' axis x1y1 set output "output_incore.png" -plot "/tmp/rtorrent.incore.8032" using 1:2 smooth bezier with lines title 'Incore cont.' axis x1y1,\ - "/tmp/rtorrent.incore.8032" using 1:4 smooth bezier with lines title 'Not incore cont.' axis x1y1,\ - "/tmp/rtorrent.incore.8032" using 1:3 smooth bezier with lines title 'Incore new' axis x1y1,\ - "/tmp/rtorrent.incore.8032" using 1:5 smooth bezier with lines title 'Not incore new' axis x1y1 +plot "$2" using 1:2 smooth bezier with lines title 'Incore cont.' axis x1y1,\ + "$2" using 1:3 smooth bezier with lines title 'Incore new' axis x1y2,\ + "$2" using 1:4 smooth bezier with lines title 'Not incore cont.' axis x1y1,\ + "$2" using 1:5 smooth bezier with lines title 'Not incore new' axis x1y2 +EOF diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 1242dc7c..29a09a44 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -617,7 +617,7 @@ DownloadList::confirm_finished(Download* download) { download->set_resume_flags(~uint32_t()); if (find(infohash) != end() && - !download->is_active() && rpc::call_command_value("d.get_state", rpc::make_target(download)) == 1) + !download->is_active() && rpc::call_command_value("d.state", rpc::make_target(download)) == 1) resume(download, torrent::Download::start_no_create | torrent::Download::start_skip_tracker | diff --git a/src/ui/download.cc b/src/ui/download.cc index 0cc4ca7d..faf86064 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -299,21 +299,21 @@ void Download::receive_max_uploads(int t) { m_windowDownloadStatus->mark_dirty(); - m_download->download()->set_uploads_max(std::max(m_download->download()->uploads_max() + t, (uint32_t)2)); + m_download->download()->set_uploads_max(std::max(m_download->download()->uploads_max() + t, 0)); } void Download::receive_min_peers(int t) { m_windowDownloadStatus->mark_dirty(); - m_download->download()->connection_list()->set_min_size(std::max(m_download->download()->connection_list()->min_size() + t, (uint32_t)5)); + m_download->download()->connection_list()->set_min_size(std::max(m_download->download()->connection_list()->min_size() + t, (int32_t)5)); } void Download::receive_max_peers(int t) { m_windowDownloadStatus->mark_dirty(); - m_download->download()->connection_list()->set_max_size(std::max(m_download->download()->connection_list()->max_size() + t, (uint32_t)5)); + m_download->download()->connection_list()->set_max_size(std::max(m_download->download()->connection_list()->max_size() + t, (int32_t)5)); } void diff --git a/src/ui/element_download_list.cc b/src/ui/element_download_list.cc index 58db1d0f..8fc08528 100644 --- a/src/ui/element_download_list.cc +++ b/src/ui/element_download_list.cc @@ -68,7 +68,7 @@ ElementDownloadList::ElementDownloadList() : m_bindings['\x0B'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.ignore_commands.set=1; d.stop=; d.close="); m_bindings['\x12'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.complete.set=0; d.check_hash="); m_bindings['\x05'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), - "f.multicall=,f.set_create_queued=,f.set_resize_queued=; print=\"Queued create/resize of files in torrent.\""); + "f.multicall=,f.set_create_queued=0,f.set_resize_queued=0; print=\"Queued create/resize of files in torrent.\""); m_bindings['+'] = sigc::mem_fun(*this, &ElementDownloadList::receive_next_priority); m_bindings['-'] = sigc::mem_fun(*this, &ElementDownloadList::receive_prev_priority);