summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2019-09-02 13:10:30 +0100
committerSimon McVittie <smcv@collabora.com>2019-09-02 13:59:37 +0100
commit1079a9a79858f8b835d8256d9726e82ddc1feb57 (patch)
tree6aa369d602a24481b9be76856b8f50adbf8761b4 /dbus
parente9f658d9d57b97395545c5ed2eaf9a85436f135d (diff)
Don't reply to NO_REPLY method calls
This avoids unnecessary bus traffic, and when used on the system bus it also avoids system log spam from the dbus-daemon rejecting the unexpected reply. Closes: https://gitlab.freedesktop.org/dbus/dbus-python/issues/26 Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus')
-rw-r--r--dbus/service.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/dbus/service.py b/dbus/service.py
index e42ea70..fd57054 100644
--- a/dbus/service.py
+++ b/dbus/service.py
@@ -267,7 +267,8 @@ def _method_reply_return(connection, message, method_name, signature, *retval):
'%s: %s', retval, signature, e.__class__, e)
raise
- connection.send_message(reply)
+ if not message.get_no_reply():
+ connection.send_message(reply)
def _method_reply_error(connection, message, exception):
@@ -295,7 +296,8 @@ def _method_reply_error(connection, message, exception):
exception))
reply = ErrorMessage(message, name, contents)
- connection.send_message(reply)
+ if not message.get_no_reply():
+ connection.send_message(reply)
class InterfaceType(type):