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);


--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29082
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I580c00f3b5ade05ecb20a92ce4ece2854334a41f
Gerrit-Change-Number: 29082
Gerrit-PatchSet: 2
Gerrit-Owner: msuraev <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: msuraev <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-MessageType: merged

Reply via email to