bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
* Errors via the clear_request callback...
* no more transactions and operations are going on.
This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 92fe661..46a3343 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -104,13 +104,20 @@
if (rc != BSC_API_CONN_POL_ACCEPT) {
subscr_con_free(lchan->conn);
- lchan_auto_release(lchan);
+ lchan_release(lchan, 0, 0);
}
}
return 0;
}
+int gsm0808_clear(struct gsm_subscriber_connection* conn)
+{
+ subscr_con_free(conn);
+ lchan_release(conn->lchan, 1, 0);
+ return 0;
+}
+
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id)
{
struct bsc_api *api;
@@ -155,12 +162,12 @@
if (!lchan || !lchan->conn)
return 0;
-
bsc = lchan->ts->trx->bts->network->bsc_api;
if (!bsc || !bsc->clear_request)
return 0;
bsc->clear_request(lchan->conn, 0);
+ subscr_con_free(lchan->conn);
return 0;
}