aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2022-08-14 14:26:16 +0700
committerMax <msuraev@sysmocom.de>2022-08-21 20:01:50 +0700
commitf7bea130e6123f336d4640118f44a9ecb6adb55a (patch)
tree956374f09491197469ebcd5b26daabc5e74fc404 /src/stream.c
parentc8241421bcc1468697503ab1b61e8dea68fac2f1 (diff)
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
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c6
1 files changed, 3 insertions, 3 deletions
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 @@ static void osmo_stream_srv_write(struct osmo_stream_srv *conn)
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 @@ static void osmo_stream_srv_write(struct osmo_stream_srv *conn)
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 @@ static void osmo_stream_srv_write(struct osmo_stream_srv *conn)
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);