X-Git-Url: http://git.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd.c;h=6629720831348573ed7c6727036b67a2ea15ab68;hp=aa723511e58709ab7730cd84ac11f44933b31fdd;hb=47d75dd84af8ba6e9bac0d24861653e11796bdb0;hpb=95648dadba44dd92fc919dddb10f39050500c629 diff --git a/ubusd.c b/ubusd.c index aa72351..6629720 100644 --- a/ubusd.c +++ b/ubusd.c @@ -136,6 +136,9 @@ void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub, bool free) { int written; + if (ub->hdr.type != UBUS_MSG_MONITOR) + ubusd_monitor_message(cl, ub, true); + if (!cl->tx_queue[cl->txq_cur]) { written = ubus_msg_writev(cl->sock.fd, ub, 0); if (written >= ub->len + sizeof(ub->hdr)) @@ -179,6 +182,7 @@ static void handle_client_disconnect(struct ubus_client *cl) while (ubus_msg_head(cl)) ubus_msg_dequeue(cl); + ubusd_monitor_disconnect(cl); ubusd_proto_free_client(cl); if (cl->pending_msg_fd >= 0) close(cl->pending_msg_fd); @@ -297,6 +301,7 @@ retry: cl->pending_msg_fd = -1; cl->pending_msg_offset = 0; cl->pending_msg = NULL; + ubusd_monitor_message(cl, ub, false); ubusd_proto_receive_message(cl, ub); goto retry; }