aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c6
1 files changed, 6 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 @@ void osmo_stream_cli_close(struct osmo_stream_cli *cli)
{
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;