pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30720 )
Change subject: stream: Log error on short send ......................................................................
stream: Log error on short send
This is clearly a problem on TCP streams which needs to be addressed in the future.
Change-Id: I9bd257b80a378b779df84e204673f8e394eca5b6 --- M src/stream.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/20/30720/1
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 @@ 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 @@ } 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);