aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2024-02-19 15:33:43 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2024-02-22 11:14:54 +0100
commite6e59ac6b6724655d5dff304a454f3268afa6973 (patch)
treef659ce432c14761214ae99cfdbdb81381ad59c4a
parent02fcc89abd806bdae495a06fa566870149101bca (diff)
stream_cli: Call read callback even if connection failedjolly/work
If connection fails, osmo_stream_cli_reconnect is called, to start a reconnect-timer. Addtionally the read callback is called, so that the user of the stream client gets a notifcation. Change-Id: Ie2335987c38863bad5de1d2d4dbdf4c8373f927f Related: OS#5753
-rw-r--r--src/stream_cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stream_cli.c b/src/stream_cli.c
index bc19131..b49a7e8 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -444,7 +444,8 @@ static void stream_cli_iofd_read_cb(struct osmo_io_fd *iofd, int res, struct msg
case STREAM_CLI_STATE_CONNECTED:
if (res == 0)
osmo_stream_cli_reconnect(cli);
- else if (cli->iofd_read_cb)
+ /* Forward message to read callback, also if the connection failed. */
+ if (cli->iofd_read_cb)
cli->iofd_read_cb(cli, msg);
break;
default: