From 8897d7ec702fca9780033db42db48cced2580112 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 6 May 2016 18:23:44 +0900 Subject: [PATCH] Restart active download to apply previously not applicable options Previously, we categorized options that can be used in aria2.changeOption RPC method into 2 categories. The options in one category can be applied on the fly, meaning that download continues to be active while applying options. Another category includes options which are only applicable when downloads are waiting or paused. In this change, when active download is ordered to change options which only applicable in waiting or paused state, it is now paused, and then automatically restarted. Although we have limited number of download concurrency, the pause and restart is done atomically, and the download is inserted at the front of the queue, it is picked up immediately if the concurrency regulation allows. --- src/Option.cc | 6 +++++ src/Option.h | 2 ++ src/RequestGroup.cc | 7 ++++++ src/RequestGroup.h | 18 +++++++++++++++ src/RequestGroupMan.cc | 28 ++++++++++++++++++----- src/RpcMethod.cc | 51 +++++++++++++++++++++++++++++++++++++----- src/RpcMethod.h | 3 ++- src/RpcMethodImpl.cc | 16 +++++++++++-- src/bitfield.h | 3 +-- 9 files changed, 119 insertions(+), 15 deletions(-) diff --git a/src/Option.cc b/src/Option.cc index 93d81a1c..e2af7017 100644 --- a/src/Option.cc +++ b/src/Option.cc @@ -190,4 +190,10 @@ void Option::setParent(const std::shared_ptr