msuraev has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29082 )
Change subject: Log more details in osmo_stream_srv_write() ......................................................................
Log more details in osmo_stream_srv_write()
Log error code and amount of data: both are handy for debugging apps using the library.
Change-Id: I580c00f3b5ade05ecb20a92ce4ece2854334a41f --- M src/stream.c 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: msuraev: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/stream.c b/src/stream.c index cdd0eae..dc44a1c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1294,8 +1294,6 @@ struct llist_head *lh; int ret;
- LOGP(DLINP, LOGL_DEBUG, "sending data\n"); - if (llist_empty(&conn->tx_queue)) { osmo_fd_write_disable(&conn->ofd); return; @@ -1304,6 +1302,8 @@ llist_del(lh); msg = llist_entry(lh, struct msgb, list);
+ LOGP(DLINP, LOGL_DEBUG, "sending %u bytes of data\n", msg->len); + switch (conn->srv->sk_domain) { case AF_UNIX: ret = send(conn->ofd.fd, msg->data, msg->len, 0); @@ -1331,7 +1331,7 @@ ret = -ENOTSUP; } if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "error to send\n"); + LOGP(DLINP, LOGL_ERROR, "error to send: %s\n", strerror(-ret)); } msgb_free(msg);