From cd2ac1e2e54b2bdd3b539ac29eb461911d4b6314 Mon Sep 17 00:00:00 2001 From: Matt Fischer Date: Thu, 16 Oct 2014 17:04:11 -0500 Subject: Don't send reply messages for non-method calls in QDBusMessage QDBusMessage is intended to avoid sending reply messages unless the message is a method call without the NO_REPLY_EXPECTED flag set. However, since messages which are not method calls will never have this flag set, the code will currently cause all non-method call messages to expect a reply. This patch changes the code to examine the message type, and to only check for the flag in cases where the message is a method call. Change-Id: Ic5bb00df69d3cfb38f60bf6bfd8463fb28cf2c99 Reviewed-by: Thiago Macieira --- src/dbus/qdbusmessage.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/dbus') diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 8025636668..25206b4bb7 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -605,6 +605,10 @@ QString QDBusMessage::signature() const */ bool QDBusMessage::isReplyRequired() const { + // Only method calls can have replies + if (d_ptr->type != DBUS_MESSAGE_TYPE_METHOD_CALL) + return false; + if (!d_ptr->msg) return d_ptr->localMessage; // if it's a local message, reply is required return !q_dbus_message_get_no_reply(d_ptr->msg); -- cgit v1.2.3