pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-cbc/+/28534 )


Change subject: cbsp: Clean up conn closed paths
......................................................................

cbsp: Clean up conn closed paths

Change-Id: I08d1da97f0a2d83f7f48c59bc4dbd669f4f814b3
---
M src/cbsp_server.c
1 file changed, 2 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-cbc refs/changes/34/28534/1

diff --git a/src/cbsp_server.c b/src/cbsp_server.c
index 215f643..4e47baf 100644
--- a/src/cbsp_server.c
+++ b/src/cbsp_server.c
@@ -107,7 +107,8 @@
        if (client->peer)
                client->peer->client.cbsp = NULL;
        client->conn = NULL;
-       osmo_fsm_inst_dispatch(client->fi, CBSP_SRV_E_CMD_CLOSE, NULL);
+       if (client->fi)
+               osmo_fsm_inst_dispatch(client->fi, CBSP_SRV_E_CMD_CLOSE, NULL);

        return 0;
 }
@@ -157,7 +158,6 @@
                        LOGPCC(client, LOGL_NOTICE, "Rejecting unknown CBSP 
peer %s:%d (not permitted)\n",
                                remote_ip, remote_port);
                        osmo_stream_srv_destroy(client->conn);
-                       /* FIXME: further cleanup needed? or does close_cb 
handle everything? */
                        return -1;
                }
        } else {
@@ -199,10 +199,7 @@

 void cbsp_cbc_client_close(struct osmo_cbsp_cbc_client *client)
 {
-       if (client->fi)
-               osmo_fsm_inst_dispatch(client->fi, CBSP_SRV_E_CMD_CLOSE, NULL);
        osmo_stream_srv_destroy(client->conn);
-       /* FIXME: do we need to unlink/free the client? */
 }

 /* initialize the CBC-side CBSP server */

--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/28534
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I08d1da97f0a2d83f7f48c59bc4dbd669f4f814b3
Gerrit-Change-Number: 28534
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to