libubus: do not send a status reply if UBUS_ATTR_NO_REPLY is set

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2012-12-14 20:05:34 +01:00
parent 154a87c683
commit ee9e399096

View file

@ -48,6 +48,7 @@ ubus_process_invoke(struct ubus_context *ctx, struct ubus_msghdr *hdr,
struct ubus_request_data req = {};
int method;
int ret;
bool no_reply = false;
if (!obj) {
ret = UBUS_STATUS_NOT_FOUND;
@ -59,6 +60,9 @@ ubus_process_invoke(struct ubus_context *ctx, struct ubus_msghdr *hdr,
goto send;
}
if (attrbuf[UBUS_ATTR_NO_REPLY])
no_reply = blob_get_int8(attrbuf[UBUS_ATTR_NO_REPLY]);
req.peer = hdr->peer;
req.seq = hdr->seq;
req.object = obj->id;
@ -77,7 +81,7 @@ found:
ret = obj->methods[method].handler(ctx, obj, &req,
blob_data(attrbuf[UBUS_ATTR_METHOD]),
attrbuf[UBUS_ATTR_DATA]);
if (req.deferred)
if (req.deferred || no_reply)
return;
send: