daniel submitted this change.
stream: Correctly close osmo_stream_cli when in state WAIT_RECONNECT
If cli is in STREAM_CLI_STATE_WAIT_RECONNECT cli->timer is scheduled.
Delete the timer if osmo_steam_cli_close() called so we don't end up
reconnecting. Also fixes the recent test failures in
master-libosmo-sccp Jenkins jobs.
Change-Id: Ic5227432192c4007f861f171ae961a8f4dea6522
---
M src/stream.c
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/stream.c b/src/stream.c
index 6fb41f1..23efe24 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -308,6 +308,12 @@
{
if (cli->state == STREAM_CLI_STATE_CLOSED)
return;
+ if (cli->state == STREAM_CLI_STATE_WAIT_RECONNECT) {
+ osmo_timer_del(&cli->timer);
+ cli->state = STREAM_CLI_STATE_CLOSED;
+ return;
+ }
+
osmo_fd_unregister(&cli->ofd);
close(cli->ofd.fd);
cli->ofd.fd = -1;
To view, visit change 33319. To unsubscribe, or for help writing mail filters, visit settings.