Commit graph

157 commits

Author SHA1 Message Date
Felix Fietkau
dd3afa517d libubus: fix deadlock in recursive synchronous ubus requests
When synchronous request completion loops are running, the innermost
loop can receive events that can unblock the outer loops, however the
loop clears uloop_cancelled (which is set by the request completion).

This causes the event loop to continue running even while a completion
loop has already been unblocked.

Fix this by not clearing uloop_cancelled for inner loops

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-11 20:39:54 +02:00
Felix Fietkau
90037b772c libubus: fix crash on reconnect with objects that have no type
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-04-04 22:03:24 +02:00
Felix Fietkau
47b38c98ae libubus: fix passing the return code of the subscriber callback to the notifier
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-17 18:29:38 +01:00
Felix Fietkau
460301e62d libubus: fix synchronous ubus_notify without waiting for a timeout
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-17 17:55:11 +01:00
Felix Fietkau
3b66d054cc libubus: add ubus_unregister_subscriber wrapper
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-17 03:11:35 +01:00
Felix Fietkau
495f460818 libubus: add UBUS_METHOD_NOARG
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-06 16:56:33 +01:00
Thomas Gstädtner
62cdfc3d16 add systemd support
This adds basic systemd support, incl. socket activation.
If systemd build is disabled, there won't be any sign of it neither
during build nor after.
If systemd build is enabled (default), but systemd is not available,
no systemd stuff is installed, so there is no impact whatsoever.
2013-03-04 19:11:21 +01:00
Thomas Gstädtner
29a2ed2f17 make UBUS_UNIX_SOCKET configurable via cmake
this is mainly useful to have a single location to read the setting
from, when it is used multiple times at build time (which it will in a
following patch) :)
2013-03-04 19:11:15 +01:00
Thomas Gstädtner
a15a09aed4 add INCLUDE_DIRECTORIES to subdirectories 2013-03-03 03:43:22 +01:00
Thomas Gstädtner
80d64827e9 make building examples an option 2013-03-03 03:43:06 +01:00
Felix Fietkau
82713b9d49 build: remove install prefix override
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-23 15:22:46 +01:00
Jo-Philipp Wich
bf566871bd lua: pass u64 blob type as double to Lua 2013-01-13 20:37:19 +01:00
Felix Fietkau
7c140855d9 libubus: free internal blob_buf memory when freeing an ubus context
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-30 14:14:22 +01:00
Felix Fietkau
bb856ad8a9 examples: disable the message on the server example, measure the notify latency on the client example
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 16:52:03 +01:00
Felix Fietkau
3642af8097 libubus: fix data type of request sequence counter. fixes hang after ~64K requests
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 16:51:28 +01:00
Felix Fietkau
4b9ed896cf libubus: fix uninitialized variable warning
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 14:11:15 +01:00
Felix Fietkau
54c78ed905 examples: use blocking notify
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 00:37:26 +01:00
Felix Fietkau
f3fabd45a7 libubus: implement notify handling
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 00:37:09 +01:00
Felix Fietkau
c2158ae53c libubus: fix segfaults on request timeouts
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 00:35:12 +01:00
Felix Fietkau
79c40c95db ubusd: implement notify forwarding with status reporting
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 00:32:27 +01:00
Felix Fietkau
e9431842e2 libubus: check if subscriber cb is non-NULL before calling it
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 21:27:52 +01:00
Felix Fietkau
ee9e399096 libubus: do not send a status reply if UBUS_ATTR_NO_REPLY is set
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 20:05:34 +01:00
Felix Fietkau
154a87c683 libubus: add UBUS_ATTR_NO_REPLY and add policy for UBUS_ATTR_ACTIVE
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 20:05:06 +01:00
Felix Fietkau
2224658580 move ubus_start_request to libubus-req.c
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 19:48:26 +01:00
Felix Fietkau
1579969983 libubus: remove accidentally committed unused header file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 14:14:43 +01:00
Felix Fietkau
2cae3fb422 libubus: refactor code, move request handling to libubus-req.c
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 14:13:27 +01:00
Felix Fietkau
7cd33a8e3a libubus: reduce code duplication and add stack depth protection for unsubscribe/notify callbacks
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 13:42:10 +01:00
Felix Fietkau
0fccce4445 remove the "method" argument for object subscription
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 13:11:40 +01:00
Felix Fietkau
a69f062cbd ubus: add notification for subscribers present/gone
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-14 13:00:57 +01:00
Felix Fietkau
d366a6de83 watch add/remove -> subscribe/unsubscribe:
rename the ADD_WATCH/REMOVE_WATCH messages to SUBSCRIBE/UNSUBSCRIBE and change
the message format and libubus API in preparation for adding object notifications

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-13 19:35:38 +01:00
Felix Fietkau
43d6047c40 ubusd: use avl_strcmp
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-11 23:38:00 +01:00
Felix Fietkau
9f706a2d27 libubus: fix stack space init for processing requests
Fixes client timeouts on invoke on some platforms

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-10-30 13:41:28 +01:00
Felix Fietkau
a6f52f058e libubus: split out some code into separate source files 2012-10-24 15:07:35 +02:00
Felix Fietkau
fc913a077d examples: split client/server code 2012-10-24 14:37:57 +02:00
Felix Fietkau
57d1599c1a move example to examples/ 2012-10-24 14:37:57 +02:00
Jo-Philipp Wich
77eefb3bdd lua: remove a superfluous lua_pop() when checking table style 2012-10-17 15:32:26 +02:00
Jo-Philipp Wich
9c0b821573 lua: fix ubus_lua_format_blob_is_array() to not leave garbage on the stack 2012-10-16 19:37:31 +03:00
Felix Fietkau
600ec9fd73 add deferred reply to the ubus server example 2012-10-01 14:09:37 +02:00
Felix Fietkau
7864896a1b add support for deferring a reply to a method invoke call 2012-10-01 14:09:19 +02:00
John Crispin
0f793d3a45 lua: propagate incoming message to method callback inside the lua context
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-29 01:41:09 +02:00
Felix Fietkau
1e3220d9df cli: add array and table types to method signature dump 2012-09-28 23:10:23 +02:00
John Crispin
73380e45c9 add lua binding test scripts
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-27 14:05:51 +02:00
Felix Fietkau
c382792d98 lua: add support for registering methods
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-27 14:00:49 +02:00
Felix Fietkau
0371c8f5fd lua: add uloop support 2012-09-27 13:59:47 +02:00
John Crispin
115b7a8c73 lua: allow building the lua binding with vanilla lua
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-27 13:49:45 +02:00
Felix Fietkau
a62e2f8c15 libubus: fix multiple inclusions of libubus.h 2012-06-01 10:09:14 +02:00
Felix Fietkau
34161692fa libubus: add support for reconnecting (and re-publishing objects) 2012-05-29 00:56:37 +02:00
Felix Fietkau
df69022beb enable -Wmissing-declarations 2012-05-29 00:41:39 +02:00
Felix Fietkau
960c342b4a lua: add a prototype for luaopen_ubus so that -Wmissing-declarations can be enabled 2012-05-29 00:41:27 +02:00
Felix Fietkau
95062c1ef7 make a few functions static 2012-05-29 00:40:50 +02:00