A message system like D-Bus for Liminix, taken from OpenWRT's ubus
e02813b2cc
This makes it clear that `ubus_msg_send()` is only about sending and queue-ing messages, and has nothing to do with free-ing. It can be a bit misleading/confusing when trying to go through the code and make assumptions about whether a buffer is free'd in ubus_send_msg(), or is free'd outside. In `ubusd_proto_receive_message()` the `ubus_msg_free()` is now called before the `if (ret == -1)` check. That way, all callbacks will have their messages free'd, which is what's desired, but confusing, because: * ubusd_handle_invoke() called ubus_msg_free() before returning -1 * ubusd_handle_notify() called ubus_msg_free() before returning -1 * ubusd_handle_response() called ubus_msg_send(,,free=true) before returning -1 * ubus_msg_send() would call ubus_msg_send(,,free=false) * all other callback callers would `ubus_msg_send(,,free=true)` (free the buffers in ubus_msg_send() ) In all other places, where `ubus_msg_send(,,free=true)` an explicit `ubus_msg_free()` was added. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> |
||
---|---|---|
examples | ||
lua | ||
.gitignore | ||
cli.c | ||
CMakeLists.txt | ||
libubus-acl.c | ||
libubus-internal.h | ||
libubus-io.c | ||
libubus-obj.c | ||
libubus-req.c | ||
libubus-sub.c | ||
libubus.c | ||
libubus.h | ||
ubus_common.h | ||
ubusd.c | ||
ubusd.h | ||
ubusd_acl.c | ||
ubusd_acl.h | ||
ubusd_event.c | ||
ubusd_id.c | ||
ubusd_id.h | ||
ubusd_monitor.c | ||
ubusd_obj.c | ||
ubusd_obj.h | ||
ubusd_proto.c | ||
ubusmsg.h |