summaryrefslogtreecommitdiff
path: root/src/RpcRequest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-09-25 23:36:00 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-09-25 23:36:00 +0900
commit374955da0df726bc643d6466b97ece8b534ad3eb (patch)
tree5ee92369bea106c00518fd82b06c22ed9e3564c8 /src/RpcRequest.cc
parentfee9b95db376752dc91c61334abbea0add6fcd5b (diff)
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.
Diffstat (limited to 'src/RpcRequest.cc')
-rw-r--r--src/RpcRequest.cc36
1 files changed, 0 insertions, 36 deletions
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