jolly has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-netif/+/36020?usp=email )
Change subject: stream_cli: Call read callback even if connection failed
......................................................................
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
https://gerrit.osmocom.org/c/libosmo-netif/+/36020?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ie2335987c38863bad5de1d2d4dbdf4c8373f927f
Gerrit-Change-Number: 36020
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-MessageType: newchange