chiark / gitweb /
bus-proxyd: optimize replies if they're not requested
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 19:58:59 +0000 (20:58 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 19:58:59 +0000 (20:58 +0100)
If a caller does not request a reply, dont send it. This skips message
creation and speeds up NO_REPLY_EXPECTED cases. Note that sd-bus still
handles this case internally, but if we handle it in bus-proxyd, we can
skip the whole message creation step.

src/bus-proxyd/bus-proxyd.c

index 549120b23dbede1b74940968e0d9fa561720515b..44e16fcd15c6b87a536cd1a66aee62a981fe28a3 100644 (file)
@@ -405,6 +405,9 @@ static int synthetic_reply_return_strv(sd_bus_message *call, char **l) {
 
         assert(call);
 
+        if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
+                return 0;
+
         r = sd_bus_message_new_method_return(call, &m);
         if (r < 0)
                 return synthetic_reply_method_errno(call, r, NULL);