aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-12-20 15:13:26 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2022-12-20 15:22:44 +0100
commitbe6a895edecdf9bedca6728ce51d22368799789f (patch)
tree54d66f9888622d66c5bdb097969b60158991e46b
parentc02ee5e8d9e853f7e4faab76eb57831d694cf7cf (diff)
stream: Log error on short send
This is clearly a problem on TCP streams which needs to be addressed in the future. Related: OS#5836 Change-Id: I9bd257b80a378b779df84e204673f8e394eca5b6
-rw-r--r--src/stream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stream.c b/src/stream.c
index e9860c3..1ca4e9a 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -384,6 +384,8 @@ static int osmo_stream_cli_write(struct osmo_stream_cli *cli)
osmo_stream_cli_reconnect(cli);
}
LOGSCLI(cli, LOGL_ERROR, "error %d to send\n", ret);
+ } else if (ret < msgb_length(msg)) {
+ LOGP(DLINP, LOGL_ERROR, "short send: %d < exp %u\n", ret, msgb_length(msg));
}
msgb_free(msg);
return 0;
@@ -1344,6 +1346,8 @@ static void osmo_stream_srv_write(struct osmo_stream_srv *conn)
}
if (ret == -1) /* send(): On error -1 is returned, and errno is set appropriately */
LOGP(DLINP, LOGL_ERROR, "error to send: %s\n", strerror(errno));
+ else if (ret < msgb_length(msg))
+ LOGP(DLINP, LOGL_ERROR, "short send: %d < exp %u\n", ret, msgb_length(msg));
msgb_free(msg);