X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd.c;h=5409b7f6ae57335423014d6aae0a7ee7650b3816;hp=7279a706f47e44caf92d5433326b5b733bb1b440;hb=97ac89f9727d4fae1b2d63d2fc3b59e0d5d4bf65;hpb=ad5333a73b222e95458e05d52f349194df9ae7c6 diff --git a/ubusd.c b/ubusd.c index 7279a70..5409b7f 100644 --- a/ubusd.c +++ b/ubusd.c @@ -148,12 +148,13 @@ void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub, bool free) if (!cl->tx_queue[cl->txq_cur]) { written = ubus_msg_writev(cl->sock.fd, ub, 0); - if (written >= ub->len + sizeof(ub->hdr)) - goto out; if (written < 0) written = 0; + if (written >= ub->len + sizeof(ub->hdr)) + goto out; + cl->txq_ofs = written; /* get an event once we can write to the socket again */