summaryrefslogtreecommitdiff
path: root/libubus.c
Commit message (Collapse)AuthorAgeFilesLines
* ubus: Remove unnecessary memset calls.Rosen Penev2017-11-131-4/+2
| | | | | | | Replace malloc+memset with calloc. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* libubus: move uloop_init() call to ubus_connect_ctxFelix Fietkau2017-01-221-0/+1
| | | | | | uloop should not be used before it is initialized Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ubus: ubus_free: clear pending timers before freeing contextAbhimanyu Vishwakarma2017-01-041-0/+1
| | | | | | | | | | | | If a synchronous operation is executed on a ubus context after uloop_done() has been called, the context's pending_timer may remain in uloop's list of timeouts. This leads to undefined behaviour during next execution of uloop code, as it may be referring to unavailable memory or memory that has been allocated for different purposes. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com> Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
* Allow sending a fd along a ubus_requestamine ahd2016-12-241-1/+1
| | | | Signed-off-by: amine.ahd <amine.ahd@gmail.com>
* libubus: nullify stale msgbuf pointer in case of ubus_connect_ctx() failureEyal Birger2016-05-151-0/+1
| | | | | | | | | | | If the ubus_reconnect() call fails in ubus_connect_ctx(), the msgbuf.data newly allocated buffer is freed, but its pointer in the ubus_context is not removed. This leads to a double free error if ubus_auto_shutdown() is called for cleanup after ubus_auto_connect() failed to connect to ubusd. Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
* libubus: add null for ubus_context object in ubus_shutdown()Alexandru Ardelean2015-12-191-0/+2
| | | | | | | | At the moment, we do our own null checks before calling ubus_free(). The likely-hood of 'ctx' being null (in ubus_free()) is low, but since free() handles null, might make sense for ubus_free() to do so as well. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* libubus: add monitor supportFelix Fietkau2015-11-191-0/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: Fix reverse order processing of pending ubus notifications messagesHans Dedecker2015-11-021-1/+1
| | | | | | | | Append ubus notification messages to the tail of the pending list so they're processed in the order as they're put onto the pending list Signed-off-by: Xinxing Hu <xinxing.huchn@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* libubus: expose ubus_connect_ctx() in public APIDelio Brignoli2014-10-141-4/+11
| | | | | | | | | ubus_connect_ctx() is equivalent to ubus_connect() but accepts a pointer to a previously allocated ubus_context struct. ubus_shutdown() is made available as an alternative to ubus_free() to clean up contexts initialised by ubus_connect_ctx(). Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
* libubus: remove ubus_msghdr_data() by passing in the right data structure ↵Felix Fietkau2014-09-151-12/+10
| | | | | | pointer Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: use calloc_a for queued msgs to reduce the number of allocationsFelix Fietkau2014-09-151-8/+5
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: fix a small memleak in ubus_register_event_handler()Felix Fietkau2014-09-041-1/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* ubus: increase message size limit and make it configurable at build-timeAlexandru Ardelean2014-07-031-1/+2
|
* libubus: refactor ubus_context msgbuf data to be dynamically allocatedAlexandru Ardelean2014-07-031-5/+17
|
* libubus: fix deferring invoke processing for non-uloop usageFelix Fietkau2014-06-251-1/+2
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: always defer processing incoming invoke/unsubscribe/notify if there ↵Felix Fietkau2014-06-241-5/+6
| | | | | | | | | is a request pending This fixes recursion problems on config reload in netifd and simplifies application handling of requests Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: implement file descriptor passing supportFelix Fietkau2014-02-181-4/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* add auto (re)connect logic to libubusJohn Crispin2014-01-221-8/+55
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* libubus: pull the variable length data array out of struct ubus_msghdr to ↵Felix Fietkau2013-10-291-2/+2
| | | | | | fix builds with clang Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: free internal blob_buf memory when freeing an ubus contextFelix Fietkau2012-12-301-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: implement notify handlingFelix Fietkau2012-12-151-2/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* move ubus_start_request to libubus-req.cFelix Fietkau2012-12-141-16/+0
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: refactor code, move request handling to libubus-req.cFelix Fietkau2012-12-141-277/+17
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libubus: reduce code duplication and add stack depth protection for ↵Felix Fietkau2012-12-141-9/+3
| | | | | | unsubscribe/notify callbacks Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* ubus: add notification for subscribers present/goneFelix Fietkau2012-12-141-0/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* watch add/remove -> subscribe/unsubscribe:Felix Fietkau2012-12-131-75/+4
| | | | | | | 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>
* libubus: split out some code into separate source filesFelix Fietkau2012-10-241-415/+21
|
* add support for deferring a reply to a method invoke callFelix Fietkau2012-10-011-8/+13
|
* libubus: add support for reconnecting (and re-publishing objects)Felix Fietkau2012-05-291-30/+64
|
* ubusd: add support for watching objects to get notified when they go awayFelix Fietkau2012-05-191-10/+77
|
* libubus: limit stack depth for incoming invoke requestsFelix Fietkau2011-10-271-1/+40
|
* libubus: fix recursive synchrnonous invoke commandsFelix Fietkau2011-10-271-5/+8
|
* fix invalid message reuse in ubus_process_invokeFelix Fietkau2011-10-101-3/+3
|
* make the socket non-blocking, explicitly wait for data using poll()Felix Fietkau2011-09-091-3/+15
|
* add an error message for "unknown error"Felix Fietkau2011-09-051-0/+1
|
* add an error code for "operation not supported"Felix Fietkau2011-09-051-0/+1
|
* add copyright/license informationFelix Fietkau2011-06-171-0/+13
|
* simplify object signatures by reusing the parser policy to define themFelix Fietkau2011-03-271-46/+16
|
* add support for timeouts on synchronous requestsFelix Fietkau2011-02-111-40/+70
|
* remove separate catch all list, always require a pattern argument for ↵Felix Fietkau2011-02-111-3/+1
| | | | registering events, even if it is just *
* add writev_retry to avoid incomplete writesFelix Fietkau2011-02-111-1/+34
|
* add sender side length checksFelix Fietkau2011-02-071-7/+26
|
* remove unnecessary debug stuffFelix Fietkau2011-02-071-11/+0
|
* fix max message length handling - exclude the headerFelix Fietkau2011-02-071-1/+1
|
* add code for sending events and fix the code for receiving eventsFelix Fietkau2011-02-071-1/+18
|
* make ubus_default_connection_lost staticFelix Fietkau2011-02-071-1/+1
|
* add ubus_remove_object to libubusFelix Fietkau2011-02-061-0/+37
|
* follow blob_get_int* -> blob_get_u* renameFelix Fietkau2011-02-061-7/+7
|
* rename publish to add_objectFelix Fietkau2011-02-061-7/+7
|
* fix SIGINT handlingFelix Fietkau2011-02-061-0/+2
|