ubus deferred request enhancements#282
Merged
jow- merged 5 commits intojow-:masterfrom Mar 16, 2025
Merged
Conversation
ecde3b2 to
d94c0c9
Compare
Contributor
Author
|
@jow- any comments? I need this PR for a new package that I intend to push soon. |
jow-
reviewed
Mar 13, 2025
jow-
reviewed
Mar 13, 2025
jow-
reviewed
Mar 14, 2025
Add a local helper macro errval_return() which sets a local error code and returns it. Also do some minor whitespace and code style fixes while we're at it. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Works in the same way as regular defer calls, except that it operates on channels. Signed-off-by: Felix Fietkau <nbd@nbd.name> [use errval_return(), minor whitespace changes] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
When passing UBUS_STATUS_CONTINUE (or -1) in the return code argument, assume that more reply calls are coming and only send a reply data message without the status code. Signed-off-by: Felix Fietkau <nbd@nbd.name> [minor whitespace changes] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
…op.run() Calling ubus.defer() outside of uloop.run() was apparently broken since commit 1cb04f9 ("ubus: add object publishing, notify and subscribe support") from March 2022. It was supposed to block until the request completes, however it blocked forever due to a counter imbalance introduced by the above commit. These days this 'feature' is of questionable value, since req.await() exists, and there is a legitimate use for issuing deferred requests from outside of uloop.run() and then calling uloop.run() or req.await() afterwards. Since nobody noticed the breakage in all this time, let's just get rid of this API footgun. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Explicitly zero-initialize `obi` in `_args_get()` to avoid the following
compiler warning:
.../ubus.c: In function ‘_args_get’:
.../ubus.c:100:31: error: ‘obj’ may be used uninitialized [-Werror=maybe-uninitialized]
100 | arg = ucv_object_get(obj, name, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Owner
|
Merged with some code style adjustments, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve support for deferring and handling deferred requests