daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33221 )
Change subject: stream: Update log messages ......................................................................
stream: Update log messages
Change-Id: Ife20b9d18e6ca86a06991d68165694e31052c58a --- M src/stream.c M tests/stream/stream_test.err 2 files changed, 17 insertions(+), 10 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/src/stream.c b/src/stream.c index 90b793f..2e38916 100644 --- a/src/stream.c +++ b/src/stream.c @@ -281,7 +281,7 @@ osmo_stream_cli_close(cli);
if (cli->reconnect_timeout < 0) { - LOGSCLI(cli, LOGL_INFO, "not reconnecting, disabled.\n"); + LOGSCLI(cli, LOGL_INFO, "not reconnecting, disabled\n"); return; }
@@ -395,7 +395,7 @@ if (errno == EPIPE || errno == ENOTCONN) { osmo_stream_cli_reconnect(cli); } - LOGSCLI(cli, LOGL_ERROR, "error %d to send\n", ret); + LOGSCLI(cli, LOGL_ERROR, "received error %d in response to send\n", errno); }
msgb_free(msg); @@ -439,7 +439,7 @@ if (llist_empty(&cli->tx_queue)) osmo_fd_write_disable(&cli->ofd);
- LOGSCLI(cli, LOGL_DEBUG, "connection done.\n"); + LOGSCLI(cli, LOGL_DEBUG, "connection established\n"); cli->state = STREAM_CLI_STATE_CONNECTED; switch (cli->sk_domain) { case AF_UNIX: @@ -882,7 +882,7 @@ { struct osmo_stream_cli *cli = data;
- LOGSCLI(cli, LOGL_DEBUG, "reconnecting.\n"); + LOGSCLI(cli, LOGL_DEBUG, "reconnecting\n"); osmo_stream_cli_open(cli); }
@@ -1319,7 +1319,7 @@ LOGP(DLINP, LOGL_DEBUG, "message received\n");
if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) { - LOGP(DLINP, LOGL_DEBUG, "Connection is being flushed and closed; ignoring received message\n"); + LOGP(DLINP, LOGL_INFO, "Connection is being flushed and closed; ignoring received message\n"); return 0; }
@@ -1423,11 +1423,9 @@ OSMO_ASSERT(link);
conn = talloc_zero(ctx, struct osmo_stream_srv); - if (conn == NULL) { - LOGP(DLINP, LOGL_ERROR, "cannot allocate new peer in srv, " - "reason=`%s'\n", strerror(errno)); + if (conn == NULL) return NULL; - } + conn->srv = link; osmo_fd_setup(&conn->ofd, fd, OSMO_FD_READ, osmo_stream_srv_cb, conn, 0); conn->read_cb = read_cb; diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err index 9ed9973..ca98c82 100644 --- a/tests/stream/stream_test.err +++ b/tests/stream/stream_test.err @@ -38,6 +38,6 @@
{11.000018} non-reconnecting test step 1 [client OK, server OK], FD reg 1 [CONNECTED] osmo_stream_cli_recv(): connection closed with srv -[CLOSED] osmo_stream_cli_reconnect(): not reconnecting, disabled. +[CLOSED] osmo_stream_cli_reconnect(): not reconnecting, disabled
{20.000019} non-reconnecting test step 0 [client OK, server OK], FD reg 0