Change in libosmo-netif[master]: stream.c: Improve logging during sock send()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Jan 9 19:38:26 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/16779 )


Change subject: stream.c: Improve logging during sock send()
......................................................................

stream.c: Improve logging during sock send()

Change-Id: Iff275c809ec2bb34f471d15bfdc92296566b76a7
---
M src/stream.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/79/16779/1

diff --git a/src/stream.c b/src/stream.c
index 537fd28..fe3de2a 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -239,8 +239,6 @@
 	struct llist_head *lh;
 	int ret;
 
-	LOGSCLI(cli, LOGL_DEBUG, "sending data\n");
-
 	if (llist_empty(&cli->tx_queue)) {
 		cli->ofd.when &= ~BSC_FD_WRITE;
 		return 0;
@@ -254,6 +252,8 @@
 		return 0;
 	}
 
+	LOGSCLI(cli, LOGL_DEBUG, "sending %u bytes of data\n", msgb_length(msg));
+
 	switch (cli->proto) {
 #ifdef HAVE_LIBSCTP
 	case IPPROTO_SCTP:
@@ -266,14 +266,14 @@
 #endif
 	case IPPROTO_TCP:
 	default:
-		ret = send(cli->ofd.fd, msg->data, msg->len, 0);
+		ret = send(cli->ofd.fd, msg->data, msgb_length(msg), 0);
 		break;
 	}
 	if (ret < 0) {
 		if (errno == EPIPE || errno == ENOTCONN) {
 			osmo_stream_cli_reconnect(cli);
 		}
-		LOGSCLI(cli, LOGL_ERROR, "error to send\n");
+		LOGSCLI(cli, LOGL_ERROR, "error %d to send\n", ret);
 	}
 	msgb_free(msg);
 	return 0;

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

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iff275c809ec2bb34f471d15bfdc92296566b76a7
Gerrit-Change-Number: 16779
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200109/6788fb72/attachment.htm>


More information about the gerrit-log mailing list