[OpenWrt-Devel] [PATCH] libubus: fix msgbuf reduction logic during receive
Alexandru Ardelean
ardeleanalex at gmail.com
Thu Aug 7 01:30:16 EDT 2014
please disregard this patch
just saw something wrong with it;
will resend
On Wed, Aug 6, 2014 at 2:42 PM, Alexandru Ardelean <ardeleanalex at gmail.com>
wrote:
> Signed-off-by: Alexandru Ardelean <aa at ocedo.com>
> ---
> libubus-io.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/libubus-io.c b/libubus-io.c
> index 31dad27..87569a5 100644
> --- a/libubus-io.c
> +++ b/libubus-io.c
> @@ -256,12 +256,10 @@ static bool get_next_msg(struct ubus_context *ctx,
> int *recv_fd)
> len = blob_raw_len(&hdrbuf.data);
> if (len > ctx->msgbuf_data_len) {
> ctx->msgbuf_reduction_counter =
> UBUS_MSGBUF_REDUCTION_INTERVAL;
> - } else if (ctx->msgbuf_data_len > UBUS_MSG_CHUNK_SIZE) {
> - if (ctx->msgbuf_reduction_counter > 0) {
> - len = -1;
> - --ctx->msgbuf_reduction_counter;
> - } else
> - len = UBUS_MSG_CHUNK_SIZE;
> + } else
> + if (ctx->msgbuf_reduction_counter > 0 &&
> + ctx->msgbuf_data_len < UBUS_MSG_CHUNK_SIZE) {
> + len = (0 == --ctx->msgbuf_reduction_counter) ?
> UBUS_MSG_CHUNK_SIZE : -1;
> } else
> len = -1;
>
> --
> 1.8.4.5
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20140807/7636979e/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list