pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-netif/+/38892?usp=email )
Change subject: stream_cli: Log all code paths ending up in close/reconnect
......................................................................
stream_cli: Log all code paths ending up in close/reconnect
This way it's possible to track why a connection was closed od/and
reconnected (depending on reconnect config set by user).
Change-Id: I6debc5de193d99919fe858befd905223ef965d81
---
M src/stream_cli.c
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/stream_cli.c b/src/stream_cli.c
index 757de1c..25dda4f 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -353,11 +353,13 @@
OSMO_ASSERT(fd >= 0);
if (ret < 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect failed (%d)\n", res);
osmo_stream_cli_reconnect(cli);
return;
}
ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len);
if (ret >= 0 && error > 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect so_error (%d)\n", error);
osmo_stream_cli_reconnect(cli);
return;
}
@@ -895,6 +897,7 @@
}
if (ret < 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect: socket creation error (%d)\n", ret);
if (reconnect)
osmo_stream_cli_reconnect(cli);
return ret;
@@ -1001,6 +1004,7 @@
}
if (ret < 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect: socket creation error (%d)\n", ret);
osmo_stream_cli_reconnect(cli);
return ret;
}
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/38892?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I6debc5de193d99919fe858befd905223ef965d81
Gerrit-Change-Number: 38892
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>