summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-07-03 13:50:04 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-07-21 16:50:48 +0100
commitd9ee040d0bff2b421bca80c2339dcd9347d906db (patch)
tree8ebd63326cc2e867f875fab3997be6c9cd503481
parentd10ac7c57e91435c2eca5817dae51a91ff708f78 (diff)
downloaddbus-d9ee040d0bff2b421bca80c2339dcd9347d906db.tar.gz
dbus-monitor: disable automatic handling of o.fd.Peer messages
A normal DBusConnection will automatically reply to o.fd.Peer messages such as Ping. We don't want this: if we are using traditional eavesdropping with an older dbus-daemon, we'll confuse everyone else by replying to messages that weren't intended for us. If we are using the new Monitoring interface (since 1.9.12), the same still applies, but in addition, the dbus-daemon will disconnect us for not being a well-behaved monitor. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90952 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
-rw-r--r--tools/dbus-monitor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c
index 9cec0a7a..483d42ee 100644
--- a/tools/dbus-monitor.c
+++ b/tools/dbus-monitor.c
@@ -483,6 +483,11 @@ main (int argc, char *argv[])
exit (1);
}
+ /* Receive o.fd.Peer messages as normal messages, rather than having
+ * libdbus handle them internally, which is the wrong thing for
+ * a monitor */
+ dbus_connection_set_route_peer_messages (connection, TRUE);
+
if (!dbus_connection_add_filter (connection, filter_func,
_DBUS_INT_TO_POINTER (binary_mode), NULL))
{