Commit ad887b5a authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Commit Bot

dbus: Remove LOG(ERROR) in ObjectProxy

It is a valid use case for a daemon to have multiple ObjectProxies of
different services with the exact same object path and interface name.
Currently, this may cause log pollution of "rejecting a message from a
wrong sender" because one ObjectProxy receives signals intended for
another ObjectProxy. Since it's actually a valid case and not a bug, it
shouldn't be logged as error but it may still be logged with VLOG.

Currently this is discovered in Bluetooth daemon (btdispatch) because it
listens to both BlueZ's and Newblue's objects which have identical
object paths and interfaces.

Bug: 866704
Change-Id: I25b6437ec6081e244a47c635c0adedf281530967
Reviewed-on: https://chromium-review.googlesource.com/1164474Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581937}
parent 4334fb2e
......@@ -519,6 +519,11 @@ DBusHandlerResult ObjectProxy::HandleMessage(
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
std::string sender = signal->GetSender();
// Ignore message from sender we are not interested in.
if (service_name_owner_ != sender)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
const std::string interface = signal->GetInterface();
const std::string member = signal->GetMember();
......@@ -534,12 +539,6 @@ DBusHandlerResult ObjectProxy::HandleMessage(
}
VLOG(1) << "Signal received: " << signal->ToString();
std::string sender = signal->GetSender();
if (service_name_owner_ != sender) {
LOG(ERROR) << "Rejecting a message from a wrong sender.";
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
const base::TimeTicks start_time = base::TimeTicks::Now();
if (bus_->HasDBusThread()) {
// Post a task to run the method in the origin thread.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment