pespin has submitted this change. (
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.
Related: OS#5836
Change-Id: I9bd257b80a378b779df84e204673f8e394eca5b6
---
M src/stream.c
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
daniel: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
laforge: Looks good to me, approved
Jenkins Builder: Verified
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);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30720
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I9bd257b80a378b779df84e204673f8e394eca5b6
Gerrit-Change-Number: 30720
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged