mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
Bug fix: make server interface recognize booleans encoded as proper xmlrpc_c::value_boolean when parsing requests.
This commit is contained in:
parent
63eefe03fd
commit
35c4abd874
@ -235,6 +235,10 @@ check(std::map<std::string, xmlrpc_c::value> const& param,
|
|||||||
{
|
{
|
||||||
std::map<std::string, xmlrpc_c::value>::const_iterator m = param.find(key);
|
std::map<std::string, xmlrpc_c::value>::const_iterator m = param.find(key);
|
||||||
if(m == param.end()) return false;
|
if(m == param.end()) return false;
|
||||||
|
|
||||||
|
if (m->second.type() == xmlrpc_c::value::TYPE_BOOLEAN)
|
||||||
|
return xmlrpc_c::value_boolean(m->second);
|
||||||
|
|
||||||
std::string val = string(xmlrpc_c::value_string(m->second));
|
std::string val = string(xmlrpc_c::value_string(m->second));
|
||||||
if(val == "true" || val == "True" || val == "TRUE" || val == "1") return true;
|
if(val == "true" || val == "True" || val == "TRUE" || val == "1") return true;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user