ubus has a message size limit of about 64k. For some cases [like complex JSON config strings] this limit can be insufficient. Another case is when wanting to send some large base64 encoded strings of various (including binary) data.
The following set of patches remove that limit. Currently there is no limitation to the size of the packets. My tests have worked stable with 10 MB strings on a x86_64 + MIPS with 128 MB RAM. I've tested those strings for correctness with diff and meld. These patches are submitted for review. First 6 patches are the functionality update itself + fixes. The last patch is an update to the example server-client. It sends strings of numbers over ubus, and the server part validates it. The changes can also be (re)viewed here: https://github.com/commodo/ubus/commits/ubus_msg_size Alexandru Ardelean (6): libubus: refactor ubus_context msgbuf data to be dynamically allocated ubus: increase message size limit and make it configurable at build-time libubus: add logic to reduce msgbuf data size after 16 small messages libubus: fix writev_retry() function when writing large packets ubusd: replace ubusd_msg_unshare() with ubus_msg_new() to prevent invalid free-ing ubus: add count test to validate large message sizes CMakeLists.txt | 2 ++ examples/CMakeLists.txt | 4 +-- examples/client.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ examples/count.c | 48 ++++++++++++++++++++++++++++++ examples/count.h | 19 ++++++++++++ examples/server.c | 40 +++++++++++++++++++++++++ libubus-io.c | 46 +++++++++++++++++++++++++---- libubus.c | 23 +++++++++++---- libubus.h | 15 ++++++---- ubusd.c | 14 +-------- ubusmsg.h | 2 +- 11 files changed, 260 insertions(+), 31 deletions(-) create mode 100644 examples/count.c create mode 100644 examples/count.h -- 1.8.4.5 _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
