pespin submitted this change.

View Change

Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve
stream_cli: Assert reentrant disconnect_cb() never happens

This should in fact already be guarded by early return in
stream_cli_close() setting and checking for CLOSED state, but it doesn't
hurt having this assert which also provides extra information to the
reader.

Change-Id: I9a12d76e27dce2b31a2aa993b70cbed30bdea7f2
---
M src/stream_cli.c
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/stream_cli.c b/src/stream_cli.c
index 2c1b00d..43877d3 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -203,6 +203,7 @@
* Also, if reconnect is disabled by user, notify the user that connect() failed: */
if (old_state == STREAM_CLI_STATE_CONNECTED ||
(old_state == STREAM_CLI_STATE_CONNECTING && cli->reconnect_timeout < 0)) {
+ OSMO_ASSERT(!(cli->in_cb_mask & IN_CB_MASK_DISCONNECT_CB));
cli->in_cb_mask |= IN_CB_MASK_DISCONNECT_CB;
if (cli->disconnect_cb)
cli->disconnect_cb(cli);

To view, visit change 38976. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I9a12d76e27dce2b31a2aa993b70cbed30bdea7f2
Gerrit-Change-Number: 38976
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>