summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2013-08-06 06:52:43 +0000
committerBenny Prijono <bennylp@teluu.com>2013-08-06 06:52:43 +0000
commit6e48a186a1d35be3701c4caa5295925b24e0cb57 (patch)
treef72e3baf621e3391deea54bf2ad7e1963816dfa3 /pjsip
parente90af1c9e5bb500088728ddde25e16e09f3755ac (diff)
Re #1669: fixed bug introduced by r4523 which caused pjsua_acc_modify() to always reregister regardless of whether there is change or not
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4579 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 52c5685d..fd102ee8 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -1048,6 +1048,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
/* Credential info */
{
unsigned i;
+ pj_bool_t cred_changed = PJ_FALSE;
/* Selective update credential info. */
for (i = 0; i < cfg->cred_count; ++i) {
@@ -1071,6 +1072,8 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
/* Not found, insert this */
if (j == acc->cfg.cred_count) {
+ cred_changed = PJ_TRUE;
+
/* If account credential is full, discard the last one. */
if (acc->cfg.cred_count == PJ_ARRAY_SIZE(acc->cfg.cred_info)) {
pj_array_erase(acc->cfg.cred_info, sizeof(pjsip_cred_info),
@@ -1097,8 +1100,10 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
acc->cred[acc->cred_cnt++] = pjsua_var.ua_cfg.cred_info[i];
}
- update_reg = PJ_TRUE;
- unreg_first = PJ_TRUE;
+ if (cred_changed) {
+ update_reg = PJ_TRUE;
+ unreg_first = PJ_TRUE;
+ }
}
/* Authentication preference */