From: David Herrmann Date: Thu, 8 Jan 2015 19:58:59 +0000 (+0100) Subject: bus-proxyd: optimize replies if they're not requested X-Git-Tag: v219~623 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=426bb5ddb8ff122d3e08b0480466718b68485e70 bus-proxyd: optimize replies if they're not requested 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. --- diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c index 549120b23..44e16fcd1 100644 --- a/src/bus-proxyd/bus-proxyd.c +++ b/src/bus-proxyd/bus-proxyd.c @@ -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);