diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-09-25 23:36:00 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-09-25 23:36:00 +0900 |
| commit | 374955da0df726bc643d6466b97ece8b534ad3eb (patch) | |
| tree | 5ee92369bea106c00518fd82b06c22ed9e3564c8 /src/RpcRequest.cc | |
| parent | fee9b95db376752dc91c61334abbea0add6fcd5b (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.cc | 36 |
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 |
