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>
bb10
Matt Fischer 2014-10-16 17:04:11 -05:00
parent 49052ba8a8
commit cd2ac1e2e5
1 changed files with 4 additions and 0 deletions

View File

@ -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);