Fix a few issues reported by static analyzers
This commit is contained in:
@@ -29,7 +29,7 @@ const std::map<const std::string, const AdhocCommand>& AdhocCommandsHandler::get
|
||||
return this->commands;
|
||||
}
|
||||
|
||||
XmlNode&& AdhocCommandsHandler::handle_request(const std::string& executor_jid, XmlNode command_node)
|
||||
XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, XmlNode command_node)
|
||||
{
|
||||
std::string action = command_node.get_tag("action");
|
||||
if (action.empty())
|
||||
@@ -127,7 +127,7 @@ XmlNode&& AdhocCommandsHandler::handle_request(const std::string& executor_jid,
|
||||
command_node.add_child(std::move(error));
|
||||
}
|
||||
}
|
||||
return std::move(command_node);
|
||||
return command_node;
|
||||
}
|
||||
|
||||
void AdhocCommandsHandler::remove_session(const std::string& session_id, const std::string& initiator_jid)
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
* Takes a copy of the <command/> node so we can actually edit it and use
|
||||
* it as our return value.
|
||||
*/
|
||||
XmlNode&& handle_request(const std::string& executor_jid, XmlNode command_node);
|
||||
XmlNode handle_request(const std::string& executor_jid, XmlNode command_node);
|
||||
/**
|
||||
* Remove the session from the list. This is done to avoid filling the
|
||||
* memory with waiting session (for example due to a client that starts
|
||||
|
||||
@@ -286,7 +286,6 @@ void XmppComponent::handle_handshake(const Stanza& stanza)
|
||||
uint64_t usec;
|
||||
if (sd_watchdog_enabled(0, &usec) > 0)
|
||||
{
|
||||
std::chrono::microseconds delay(usec);
|
||||
TimedEventsManager::instance().add_event(TimedEvent(
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::microseconds(usec / 2)),
|
||||
[]() { sd_notify(0, "WATCHDOG=1"); }));
|
||||
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
|
||||
/**
|
||||
* An XMPP stanza is just an XML node of level 2 in the XMPP document (the
|
||||
* level 1 ones are the <stream::stream/>, and the ones about 2 are just the
|
||||
* level 1 ones are the <stream::stream/>, and the ones above 2 are just the
|
||||
* content of the stanzas)
|
||||
*/
|
||||
typedef XmlNode Stanza;
|
||||
|
||||
Reference in New Issue
Block a user