Repository navigation
Releases: oskarirauta/ubus_cpp
Releases · oskarirauta/ubus_cpp
Release list
v4.4.0
Release v4.4.0 Guard the C++ handler/callback invocations against exceptions so a throw can no longer unwind through libubus/libubox C frames to std::terminate (which would kill the whole process - e.g. a supervisor daemon losing all its supervision on one bad request): - common_handler() wraps the cb / dcb calls: a throwing ubus method handler now returns UBUS_STATUS_UNKNOWN_ERROR instead of aborting. - common_task() wraps the uloop task callback: a throwing task is dropped rather than fatal. Both log the exception to stderr on catch. The library previously only caught while parsing the *incoming* blob, not while running user handlers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v4.3.0
Release v4.3.0 Bugfix release for the subscription/notify feature added in v4.2.0. - subscription destructor now also calls ubus_unregister_subscriber() (not only ubus_unsubscribe()); without it the subscriber object was left registered in the ubus context, so once the subscription state was freed the context held a dangling pointer -> use-after-free at the next object traversal / ubus_shutdown. - ~ubus() clears the ubus_subscriber_cbs map too, matching the other static maps. - Drop the unused subscription::state::cb (notify_trampoline reads the static map) and the dead iterator writes in uloop's common_task(). - uloop::exit() no longer re-memsets exit_task while it is still pending, so a second exit() in the same cycle can't corrupt a node that is still in the uloop tree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v4.2.0
Release v4.2.0 feat: add subscription/notification support and batch calls - Add `ubus::subscription` RAII handle for subscribing to object notifications (`subscribe()` / `notify()`). - Add `call_batch()` for executing multiple synchronous calls in one go, returning results in order. - Add `subscribe_cb` to `add_object()` so objects know when they gain or lose subscribers. - Add subscriber.cpp and notifier.cpp examples demonstrating the pub/sub pattern. - Add examples for subscriber and notifier and move all examples to examples directory in root of project. - Update README.md with full API documentation for the new features. Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v4.1.0
Release v4.1.0 Fix memory leaks, double JSON serialization, and iterator safety - Clear global handler maps (ubus_methods, ubus_event_cbs) in ubus destructor to prevent leaks on re-instantiation - Fix uloop::task::add() to use iterator instead of operator[] for safety - Add JSON serialization error checks in call_async() and send_event() - Initialize exit_task with memset before each use - Reset uloop_initialized flag in uloop::run() cleanup - Switch main.cpp to std::unique_ptr for exception-safe ubus lifetime All changes verified with Valgrind: 0 leaks, 0 errors in example code. Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v4.0.0
Release v4.0.0 Update the json_cpp submodule to v5.0.0 and substantially extend the wrapper. Fixes: - Use a local blob_buf in the request handler and in call() instead of a shared global, removing a reentrancy hazard when a call() pumps the loop while a request arrives (or a handler issues a call). - Free the blobmsg_format_json() result (previously leaked on every request). - Map JSON int to BLOBMSG_TYPE_INT64 (was INT32) in method argument policy. - Drop the unnecessary -luci link (the code uses no uci; OpenWrt and Alpine both link fine without it). - Link order: pass libraries after the objects, so it links on modern --as-needed toolchains (e.g. Alpine), not only on OpenWrt's lenient ld. New capabilities: - Deferred replies: a method may set dcb and reply later via a copyable ubus::request handle (request.reply()/valid()) - slow work no longer blocks the event loop. - Asynchronous calls: call_async(obj, cmd, args, cb) with cb(result, ok). - Events: send_event() to broadcast and add_event_handler(pattern, cb) to listen. - Auto-reconnect (on by default): survive a ubusd restart, re-registering all objects and event handlers; also makes construction safe when ubusd is down. The synchronous cb and call() API is unchanged, so existing code keeps working. Docs/CI: - README rewritten as a full API reference with examples. - build.yml: CI build on push/pull_request in an Alpine (edge/testing) container that provides libubox/ubus; release workflow bumped to checkout@v5 and @v2 actions. Verified on a live ubus: sync + deferred (500ms defer) methods, async call, event send/receive, all working. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v3.3.0
Release v3.3.0 This release uses updated json_cpp which formats float values better for human readability. Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v3.2.0
Release 3.2.0 Fixes issue where every char* lost it's content. Fix uses strdup to allocate and duplicate it permanently to char pointers, and what is then allocated with strdup- must also be free'd - so ubus::Object destructor was created to handle that. Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v3.1.2
Release v3.1.2 - Removal of unnecessary comment Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v3.1.1
Release v3.1.1 updates json_cpp submodule Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
v3.1.0
Release v3.1.0 Fixes to Makefiles Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>