summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusmessage.cpp
diff options
context:
space:
mode:
authorMatt Fischer <matt.fischer@garmin.com>2014-10-16 17:04:11 -0500
committerMatt Fischer <matt.fischer@garmin.com>2014-11-22 00:29:16 +0100
commitcd2ac1e2e54b2bdd3b539ac29eb461911d4b6314 (patch)
tree923dbf2162c762c7f2449225d7329abbd0df70f2 /src/dbus/qdbusmessage.cpp
parent49052ba8a87fc0f8dc437d63cc541845501ab7a8 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusmessage.cpp')
-rw-r--r--src/dbus/qdbusmessage.cpp4
1 files changed, 4 insertions, 0 deletions
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);