aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/transaction.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-28 17:09:29 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-28 18:01:47 +0800
commit4049455d744455dd48fa359a220822303fc3a5be (patch)
tree262a428bb44471ee7d7ddbdf89421633ba409392 /openbsc/src/transaction.c
parent2412a07965ace5fc425b401438d21ff86ceeb2df (diff)
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.
Diffstat (limited to 'openbsc/src/transaction.c')
-rw-r--r--openbsc/src/transaction.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/openbsc/src/transaction.c b/openbsc/src/transaction.c
index c7478d668..ffabdd316 100644
--- a/openbsc/src/transaction.c
+++ b/openbsc/src/transaction.c
@@ -95,9 +95,6 @@ void trans_free(struct gsm_trans *trans)
break;
}
- if (trans->conn)
- put_subscr_con(trans->conn);
-
if (!trans->conn && trans->subscr && trans->subscr->net) {
/* Stop paging on all bts' */
paging_request_stop(NULL, trans->subscr, NULL);
@@ -108,6 +105,10 @@ void trans_free(struct gsm_trans *trans)
llist_del(&trans->entry);
+ if (trans->conn)
+ msc_release_connection(trans->conn);
+
+
talloc_free(trans);
}
@@ -155,15 +156,17 @@ int trans_lchan_change(struct gsm_subscriber_connection *conn_old,
struct gsm_trans *trans;
int num = 0;
+ if (conn_old == conn_new) {
+ LOGP(DCC, LOGL_ERROR, "Exchanging transaction with itself.\n");
+ return;
+ }
+
llist_for_each_entry(trans, &net->trans_list, entry) {
if (trans->conn == conn_old) {
+ msc_release_connection(conn_old);
- /* drop old channel use count */
- put_subscr_con(conn_old);
/* assign new channel */
trans->conn = conn_new;
- /* bump new channel use count */
- use_subscr_con(conn_new);
num++;
}
}