aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-28 12:23:52 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-01-28 12:30:24 +0100
commit3fc969e3d618df3d6748ea5b8fada8a54fea86e8 (patch)
tree05a57317109dd327d971a46be204fe4ebaa8b2f4
parent63e33ab84c2ed3841c0ec0eaa2f48cc88838a0e1 (diff)
stream: Drop data during write() while in state NONE
It should not happen anyway because no fd should be active if state is NONE, but still it's an extra check. Change-Id: I6d58762b7d10078eb8d0981c13d35cb6f85cfe86
-rw-r--r--src/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream.c b/src/stream.c
index fe3de2a..1a38e77 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -247,7 +247,7 @@ static int osmo_stream_cli_write(struct osmo_stream_cli *cli)
llist_del(lh);
msg = llist_entry(lh, struct msgb, list);
- if (cli->state == STREAM_CLI_STATE_CONNECTING) {
+ if (!osmo_stream_cli_is_connected(cli)) {
LOGSCLI(cli, LOGL_ERROR, "not connected, dropping data!\n");
return 0;
}