Log a warning when we receive an iq without a from

This commit is contained in:
louiz’
2016-06-24 11:24:40 +02:00
parent 7d2a2dc8cc
commit fcb2681b7b
+3 -1
View File
@@ -285,8 +285,10 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
std::string to_str = stanza.get_tag("to"); std::string to_str = stanza.get_tag("to");
std::string type = stanza.get_tag("type"); std::string type = stanza.get_tag("type");
if (from.empty()) if (from.empty()) {
log_warning("Received an iq without a 'from'. Ignoring.");
return; return;
}
if (id.empty() || to_str.empty() || type.empty()) if (id.empty() || to_str.empty() || type.empty())
{ {
this->send_stanza_error("iq", from, this->served_hostname, id, this->send_stanza_error("iq", from, this->served_hostname, id,