aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_subscriber_base.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-22 12:34:39 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-24 21:40:47 +0100
commitdaee5ca7c1019ba973a00f5109256f64873b1b13 (patch)
tree41b1ff71210c7ab0b54bbb8aa1a2b5e2122e69d0 /openbsc/src/gsm_subscriber_base.c
parenta29e43a26fae23d5132461cf7bfa43a1ca64761f (diff)
subscr: Make it possible to keep subscribers in RAM.
This is implemented by not freeing the subscriber when the reference count becomes smaller than zero. We hope that this will save many database accesses during the congres.
Diffstat (limited to 'openbsc/src/gsm_subscriber_base.c')
-rw-r--r--openbsc/src/gsm_subscriber_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/gsm_subscriber_base.c b/openbsc/src/gsm_subscriber_base.c
index 3136ebedd..e3a04f343 100644
--- a/openbsc/src/gsm_subscriber_base.c
+++ b/openbsc/src/gsm_subscriber_base.c
@@ -86,7 +86,7 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr)
subscr->use_count--;
DEBUGP(DREF, "subscr %s usage decreased usage to: %d\n",
subscr->extension, subscr->use_count);
- if (subscr->use_count <= 0)
+ if (subscr->use_count <= 0 && !subscr->net->keep_subscr)
subscr_free(subscr);
return NULL;
}