jolly has uploaded this change for review.
stream_cli: Call read callback even if connection failed
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
---
M src/stream_cli.c
1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/20/36020/1
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 @@
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:
To view, visit change 36020. To unsubscribe, or for help writing mail filters, visit settings.