From c0595d17ff8df87af95cbd3f4a430eecaf85cbf1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 4 Oct 2009 09:01:11 +0000 Subject: [PATCH] 2009-10-04 Tatsuhiro Tsujikawa Fixed the bug that the option values changed by XML-RPC method(changeOption and changeGlobalOption) are overwritten to the previous value by the next these request which doesn't contain that option value. Supporse max-download-limit is initially 0. You changed this value to 100K by changeOption. Then you issue changeOption request to change max-upload-limit to 50K. This second request doesn't contain xml-download-limit, so it is back to initial value, 0. Another improvement is that exception is thrown when changeOption and changeGlobalOption request contains option name which doesn't allowed in each request. * src/DownloadEngine.h * src/XmlRpcMethod.cc * src/XmlRpcMethod.h * src/XmlRpcMethodImpl.cc * src/download_helper.cc * src/download_helper.h * test/XmlRpcMethodTest.cc --- ChangeLog | 20 +++++++++++ src/DownloadEngine.h | 2 +- src/XmlRpcMethod.cc | 76 ++++++++++++++++++++++++++++++---------- src/XmlRpcMethod.h | 8 +++++ src/XmlRpcMethodImpl.cc | 20 ++++++----- src/download_helper.cc | 6 ++-- src/download_helper.h | 4 +-- test/XmlRpcMethodTest.cc | 38 ++++++++++++++++++++ 8 files changed, 142 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index be6b2780..20da39a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2009-10-04 Tatsuhiro Tsujikawa + + Fixed the bug that the option values changed by XML-RPC + method(changeOption and changeGlobalOption) are overwritten to the + previous value by the next these request which doesn't contain + that option value. Supporse max-download-limit is initially 0. You + changed this value to 100K by changeOption. Then you issue + changeOption request to change max-upload-limit to 50K. This + second request doesn't contain xml-download-limit, so it is back + to initial value, 0. Another improvement is that exception is + thrown when changeOption and changeGlobalOption request contains + option name which doesn't allowed in each request. + * src/DownloadEngine.h + * src/XmlRpcMethod.cc + * src/XmlRpcMethod.h + * src/XmlRpcMethodImpl.cc + * src/download_helper.cc + * src/download_helper.h + * test/XmlRpcMethodTest.cc + 2009-10-04 Tatsuhiro Tsujikawa Added missing MetalinkParserStateImpl.{cc,h} diff --git a/src/DownloadEngine.h b/src/DownloadEngine.h index 13568c28..401142d7 100644 --- a/src/DownloadEngine.h +++ b/src/DownloadEngine.h @@ -155,7 +155,7 @@ public: SharedHandle _requestGroupMan; SharedHandle _fileAllocationMan; SharedHandle _checkIntegrityMan; - const Option* option; + Option* option; DownloadEngine(const SharedHandle& eventPoll); diff --git a/src/XmlRpcMethod.cc b/src/XmlRpcMethod.cc index 29a320a6..0253d9fd 100644 --- a/src/XmlRpcMethod.cc +++ b/src/XmlRpcMethod.cc @@ -46,6 +46,7 @@ #include "XmlRpcRequest.h" #include "XmlRpcResponse.h" #include "prefs.h" +#include "StringFormat.h" namespace aria2 { @@ -74,23 +75,32 @@ XmlRpcResponse XmlRpcMethod::execute } } - template static void gatherOption (InputIterator first, InputIterator last, - const SharedHandle