summaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-09-09 13:04:01 +0200
committerJo-Philipp Wich <jo@mein.io>2022-09-09 13:04:01 +0200
commit8e240fa8e58e68f6ea084efbdd59051ad6ce031f (patch)
tree5afedeb19dc9cec3b3cb6e9b06e6a3f916c19a88 /.github
parent5cdddd32ef3df78be7cb187446235a04491036b5 (diff)
ubus: allow object method call handlers to return a numeric status code
The implicit return style for sending ubus method replies currently always emits an UBUS_STATUS_NO_DATA code in case neither req.reply() was called, nor a deferred or object were returned by the handler function. This slightly complicates the implementation of handlers that do not wish to send reply data but simply acknowledge the request with an UBUS_STATUS_OK code. In order to simplify this use case, allow handlers to override the default status by treating integer return values as ubus error codes. After this change, the following handler: function (request) { /* do some work */ request.reply(null, 0); } ... can be rewritten as: function (request) { /* do some work */ return 0; } Suggested-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions