Commit graph

17 commits

Author SHA1 Message Date
Florian Fainelli
053be7df87 cmake: Fix find_library for ubusd and examples/server
Both ubusd and cli TARGET_LINK_LIBRARIES reference ${json} which is
obtained via find_library(), but since the find_library() is searched
after the TARGET_LINK_LIBRARIES for ubusd, ubusd always gets an empty
${json} variable.

examples/server also links against libjson-c, but we were not setting
TARGET_LINK_LIBRARIES accordingly, so do that too with ${json} appended.

This was causing linking errors for ubusd and then examples/server using
an external toolchain (stbgcc-4.8-1.x).

Fixes: 9f52d1769b ("cli: use the new json-c library name")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2016-07-01 15:12:28 +02:00
Petr Štetiar
fcf5d8af65 cmake: Add ubox, blobmsg_json libraries and include dirs lookup
Otherwise cmake uses files from system which sometimes isn't wanted, ie.
for testing.

Signed-off-by: Petr Å tetiar <ynezz@true.cz>
2016-03-07 09:38:04 +01:00
Hans Dedecker
38174a05a5 ubus: Fix memleak in examples/client in case of failure
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-05-08 12:06:39 +02:00
Hans Dedecker
7798d56301 ubus: Fix issues reported by static code analysis tool Klocwork
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-04-20 15:43:19 +02:00
Zefir Kurtisi
9841dae95a libubus: fix build error in examples/server
This fixes build warning:
/ubus.git/examples/server.c: In function 'test_hello_reply':
/ubus.git/examples/server.c:69:6: error: ignoring return value of 'pipe', declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
2014-09-17 13:29:30 +02:00
Alexandru Ardelean
af63ab64af ubus: add count test to validate large message sizes
Client creates a string "1 2 3 ... 10000 ...", sends it to the server
along with the maximum number in the string.

Server creates another string like the client sent.

It validates it and, returns strcmp()'s result.

This is loop-ed every 2 seconds.
2014-07-03 12:47:11 +02:00
Felix Fietkau
8f3c5a7b50 libubus: close file descriptor after passing it in the status msg
Simplifies handling of non-deferred requests

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-02-27 16:48:55 +01:00
Felix Fietkau
54926994e2 examples/client: receive data from the passed file descriptor
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-02-18 15:03:53 +01:00
Felix Fietkau
85dff762f9 examples/server: send a file descriptor as part of the request to the "hello" method
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-02-18 15:03:53 +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
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
54c78ed905 examples: use blocking notify
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-15 00:37:26 +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
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