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:
parent
154a87c683
commit
ee9e399096
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue