summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-04-11 21:44:30 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-04-11 23:13:21 +0900
commit4070113ef0fef840a0fdd5104c38fb23cd0008eb (patch)
tree458242805ef6d01dd42f1dce07a2633311277808 /src/main.cc
parent07d38e31adb7a01a002b0a844a47f5f8ee4fe875 (diff)
Save options directly specified for download in --save-session
This change makes --save-session save only options specified for download, more specifically, options in command-line, -i file and via RPC. The other options from conf file and default values are not saved. This will drastically decrease the size of session file.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.cc b/src/main.cc
index ed59f886..c58300f3 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -272,14 +272,16 @@ error_code::Value main(int argc, char* argv[])
// command-line. If they are left, because op is used as a template
// for new RequestGroup(such as created in RPC command), they causes
// unintentional effect.
- op->remove(PREF_OUT);
- op->remove(PREF_FORCE_SEQUENTIAL);
- op->remove(PREF_INPUT_FILE);
- op->remove(PREF_INDEX_OUT);
- op->remove(PREF_SELECT_FILE);
- op->remove(PREF_PAUSE);
- op->remove(PREF_CHECKSUM);
- op->remove(PREF_GID);
+ for(SharedHandle<Option> i = op; i; i = i->getParent()) {
+ i->remove(PREF_OUT);
+ i->remove(PREF_FORCE_SEQUENTIAL);
+ i->remove(PREF_INPUT_FILE);
+ i->remove(PREF_INDEX_OUT);
+ i->remove(PREF_SELECT_FILE);
+ i->remove(PREF_PAUSE);
+ i->remove(PREF_CHECKSUM);
+ i->remove(PREF_GID);
+ }
if(!op->getAsBool(PREF_ENABLE_RPC) && requestGroups.empty() &&
!uriListParser) {
global::cout()->printf("%s\n", MSG_NO_FILES_TO_DOWNLOAD);