pespin has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/92/38892/1
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; }