Commit graph

10 commits

Author SHA1 Message Date
Felix Fietkau
9562291f68 libubus: preserve the received message buffer for incoming invoke calls
Set ctx->msgbuf.data to NULL during the call. If ctx->msgbuf is needed
during the call, a new buffer will be allocated. If not,
ctx->msgbuf.data is restored to the previous value afterwards

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-09-15 15:40:07 +02:00
Felix Fietkau
3e45a782b2 libubus: remove ubus_msghdr_data() by passing in the right data structure pointer
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-09-15 15:33:27 +02:00
Felix Fietkau
2c71017cfb libubus: add support for defining a policy mask
This allows sharing a policy array across methods, but masking out
unused entries for individual methods.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-04-27 00:40:25 +02:00
Felix Fietkau
47a9ab0c64 libubus: implement file descriptor passing support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-02-18 15:03:53 +01:00
Felix Fietkau
a9ee3ef0cf libubus: pull the variable length data array out of struct ubus_msghdr to fix builds with clang
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-29 17:28:37 +01:00
Lukasz Baj
d486006ab9 libubus: Check if remove callback exists before call it
When process unsubscribes then remove callback is called. But it
can be NULL if not defined, so we should check it before we call it.

Signed-off-by: Lukasz Baj <l.baj@radytek.com>
2013-08-29 20:35:38 +02: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
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
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