A message system like D-Bus for Liminix, taken from OpenWRT's ubus
Find a file
Alexandru Ardelean e02813b2cc ubusd: don't free messages in ubus_send_msg() anymore
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>
2017-11-13 09:55:19 +01:00
examples cmake: Fix find_library for ubusd and examples/server 2016-07-01 15:12:28 +02:00
lua ubus: Remove unnecessary memset calls. 2017-11-13 09:46:12 +01:00
.gitignore examples: split client/server code 2012-10-24 14:37:57 +02:00
cli.c cli: fix listen_timeout compile issue 2017-02-20 11:32:19 +01:00
CMakeLists.txt build: remove /opt/local prefix 2016-11-20 16:26:19 +01:00
libubus-acl.c add acl code 2015-06-18 19:01:17 +02:00
libubus-internal.h Allow sending a fd along a ubus_request 2016-12-24 14:31:04 +01:00
libubus-io.c libubus: reset ctx->sock.error when doing ubus reconnect 2017-02-20 11:31:56 +01:00
libubus-obj.c libubus: Fix deletion from context's object AVL tree when removing object 2017-11-13 09:51:40 +01:00
libubus-req.c libubus-req: add data_cb callback handling for ubus notifications 2017-11-06 08:23:08 +01:00
libubus-sub.c libubus: fix passing the return code of the subscriber callback to the notifier 2013-03-17 18:29:38 +01:00
libubus.c ubus: Remove unnecessary memset calls. 2017-11-13 09:46:12 +01:00
libubus.h libubus-req: add data_cb callback handling for ubus notifications 2017-11-06 08:23:08 +01:00
ubus_common.h libubus: replace __init with __constructor 2014-09-17 13:29:24 +02:00
ubusd.c ubusd: don't free messages in ubus_send_msg() anymore 2017-11-13 09:55:19 +01:00
ubusd.h ubusd: don't free messages in ubus_send_msg() anymore 2017-11-13 09:55:19 +01:00
ubusd_acl.c ubusd: fix inverted check in ubusd_reply_add 2016-09-05 13:59:34 +02:00
ubusd_acl.h ubusd: fix a memory leak on user/group client info 2016-01-26 10:10:39 +01:00
ubusd_event.c ubusd: don't free messages in ubus_send_msg() anymore 2017-11-13 09:55:19 +01:00
ubusd_id.c ubusd: use avl_strcmp 2012-12-11 23:38:00 +01:00
ubusd_id.h add copyright/license information 2011-06-17 16:35:11 +02:00
ubusd_monitor.c ubusd: don't free messages in ubus_send_msg() anymore 2017-11-13 09:55:19 +01:00
ubusd_obj.c ubusd: add monitor support 2015-11-19 22:32:11 +01:00
ubusd_obj.h pass ubus_msg_buf to callback of internal object 2015-06-18 19:01:17 +02:00
ubusd_proto.c ubusd: don't free messages in ubus_send_msg() anymore 2017-11-13 09:55:19 +01:00
ubusmsg.h ubusd: add monitor support 2015-11-19 22:32:11 +01:00