pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38891?usp=email )
Change subject: stream: Improve logging around recv() failure ......................................................................
stream: Improve logging around recv() failure
Change-Id: Ic050e7141b029d984fbbcc76ffc175f8e6b01664 --- M src/stream_cli.c M src/stream_srv.c 2 files changed, 6 insertions(+), 2 deletions(-)
Approvals: pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/stream_cli.c b/src/stream_cli.c index b0dac09..757de1c 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -1162,7 +1162,9 @@ if (ret == -EAGAIN) /* Received MSG_NOTIFICATION from stream_sctp_recvmsg_wrapper() */ return ret; if (errno == EPIPE || errno == ECONNRESET) - LOGSCLI(cli, LOGL_ERROR, "lost connection with srv\n"); + LOGSCLI(cli, LOGL_ERROR, "lost connection with srv (%d)\n", errno); + else + LOGSCLI(cli, LOGL_ERROR, "recv failed (%d)\n", errno); osmo_stream_cli_reconnect(cli); return ret; } else if (ret == 0) { diff --git a/src/stream_srv.c b/src/stream_srv.c index 9b39bdc..a600ad9 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -1184,7 +1184,9 @@ if (ret == -EAGAIN) /* Received MSG_NOTIFICATION from stream_sctp_recvmsg_wrapper() */ return ret; if (errno == EPIPE || errno == ECONNRESET) - LOGSSRV(conn, LOGL_ERROR, "lost connection with client\n"); + LOGSSRV(conn, LOGL_ERROR, "lost connection with client (%d)\n", errno); + else + LOGSSRV(conn, LOGL_ERROR, "recv failed (%d)\n", errno); return ret; } else if (ret == 0) { LOGSSRV(conn, LOGL_ERROR, "connection closed with client\n");