mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 03:02:30 +00:00
Correctly handle commands that are flagged as not using targets
Fixes #1346
This commit is contained in:
@@ -214,8 +214,10 @@ execute_command(std::string method_name, const tinyxml2::XMLElement* params_elem
|
||||
// Parse out the target if available
|
||||
const auto* child = params_element->FirstChildElement("param");
|
||||
if (child != nullptr) {
|
||||
XmlRpc::object_to_target(xml_value_to_object(child->FirstChildElement("value")), cmd_itr->second.m_flags, &target);
|
||||
child = child->NextSiblingElement("param");
|
||||
if (!(cmd_itr->second.m_flags & CommandMap::flag_no_target)) {
|
||||
XmlRpc::object_to_target(xml_value_to_object(child->FirstChildElement("value")), cmd_itr->second.m_flags, &target);
|
||||
child = child->NextSiblingElement("param");
|
||||
}
|
||||
// Parse out any other params
|
||||
while (child != nullptr) {
|
||||
params.push_back(xml_value_to_object(child->FirstChildElement("value")));
|
||||
@@ -226,8 +228,10 @@ execute_command(std::string method_name, const tinyxml2::XMLElement* params_elem
|
||||
// If it's not a <params>, it's probably a <array> passed in via system.multicall
|
||||
const auto* child = params_element->FirstChildElement("data")->FirstChildElement("value");
|
||||
if (child != nullptr) {
|
||||
XmlRpc::object_to_target(xml_value_to_object(child), cmd_itr->second.m_flags, &target);
|
||||
child = child->NextSiblingElement("value");
|
||||
if (!(cmd_itr->second.m_flags & CommandMap::flag_no_target)) {
|
||||
XmlRpc::object_to_target(xml_value_to_object(child), cmd_itr->second.m_flags, &target);
|
||||
child = child->NextSiblingElement("value");
|
||||
}
|
||||
while (child != nullptr) {
|
||||
params.push_back(xml_value_to_object(child));
|
||||
child = child->NextSiblingElement("value");
|
||||
|
||||
Reference in New Issue
Block a user