From 374955da0df726bc643d6466b97ece8b534ad3eb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 25 Sep 2011 23:36:00 +0900 Subject: Throw exception if parameter has wrong type in RPC method. Formally, depending on the method implementation, this kind of error is just ignored and parameter is skipped. Now aria2 responds error for these cases. The required parameter checking is also reworked along with this change. --- src/RpcRequest.cc | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'src/RpcRequest.cc') diff --git a/src/RpcRequest.cc b/src/RpcRequest.cc index 45f4168c..337e1eee 100644 --- a/src/RpcRequest.cc +++ b/src/RpcRequest.cc @@ -64,42 +64,6 @@ RpcRequest& RpcRequest::operator=(const RpcRequest& c) return *this; } -const String* RpcRequest::getStringParam(size_t index) const -{ - const String* stringParam = 0; - if(params->size() > index) { - stringParam = asString(params->get(index)); - } - return stringParam; -} - -const Integer* RpcRequest::getIntegerParam(size_t index) const -{ - const Integer* integerParam = 0; - if(params->size() > index) { - integerParam = asInteger(params->get(index)); - } - return integerParam; -} - -const List* RpcRequest::getListParam(size_t index) const -{ - const List* listParam = 0; - if(params->size() > index) { - listParam = asList(params->get(index)); - } - return listParam; -} - -const Dict* RpcRequest::getDictParam(size_t index) const -{ - const Dict* dictParam = 0; - if(params->size() > index) { - dictParam = asDict(params->get(index)); - } - return dictParam; -} - } // namespace rpc } // namespace aria2 -- cgit