X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd.c;h=491659d7903b9bfeca2a24dd743d6c2f0451d952;hp=a1636aa1847dbaf5c980d8f3616ad5c5526ab2d7;hb=4864ab6397cee00fd84d5d11c33d8eba37b2fea6;hpb=a84c6cac9a8e57cfdbedb82f96e38079e3871995 diff --git a/ubusd.c b/ubusd.c index a1636aa..491659d 100644 --- a/ubusd.c +++ b/ubusd.c @@ -95,7 +95,7 @@ static void ubus_msg_enqueue(struct ubus_client *cl, struct ubus_msg_buf *ub) if (cl->tx_queue[cl->txq_tail]) return; - cl->tx_queue[cl->txq_tail] = ub; + cl->tx_queue[cl->txq_tail] = ubus_msg_ref(ub); cl->txq_tail = (cl->txq_tail + 1) % ARRAY_SIZE(cl->tx_queue); } @@ -180,8 +180,6 @@ static void client_cb(struct uloop_fd *sock, unsigned int events) } break; } - if (written == 0) - break; cl->txq_ofs += written; if (cl->txq_ofs < ub->len + sizeof(ub->hdr))