ubusd: move global retmsg per client Even with the tx_queue-ing issue resolved, what seems to happen afterwards, is that all the messages seems to get through, but the client still loops in the `ubus_complete_request()` waiting for `req->status_msg` or for a timeout. Though, the timeout does not seem to happen, because the data is processed in `ubus_poll_data()`, with a infinite poll() timeout (ubus_complete_request() is called with timeout 0). It's likely that either the `seq` or `peer` sent from ubusd are wrong, and the client cannot get the correct ubus request in `ubus_process_req_msg()`. I haven't digged too deep into this ; setting the `retmsg` object on the client struct seems to have resolved any hanging with the `ubus list` command. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [fix placement of retmsg in cl]
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>
ubusd: make ACL path configurable on the command line Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ubusd: add monitor support Signed-off-by: Felix Fietkau <nbd@openwrt.org>
add acl code Signed-off-by: John Crispin <blogic@openwrt.org>
make ubus_proto_send_msg_from_blob() none static Signed-off-by: John Crispin <blogic@openwrt.org>
make ubus_parse_msg() none static Signed-off-by: John Crispin <blogic@openwrt.org>
make ubusd_send_event() none static Signed-off-by: John Crispin <blogic@openwrt.org>
ubusd: implement protocol support for passing file descriptors as part of request completion msgs from objects to clients Signed-off-by: Felix Fietkau <nbd@openwrt.org>
add copyright/license information
add notifications for registered/unregistered objects with path
move more protocol related stuff to ubusd_proto.c
make ubus_msg_ref static
make ubusd_get_client_by_id static
make ubus_parse_msg static
add code for sending events and fix the code for receiving events
remove duplicate definition of UBUS_UNIX_SOCKET
fix message buffering
add some stub functionality for the ubus event switch
Initial import