Skip to content

Commit

Permalink
modules/ims_registrar_scscf: protection around sending notifications …
Browse files Browse the repository at this point in the history
…- prevent races
  • Loading branch information
jaybeepee committed Mar 17, 2016
1 parent 9fbf7a7 commit 82c42dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/ims_registrar_scscf/save.c
Expand Up @@ -859,11 +859,14 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
LM_DBG("ref count after sub is now %d\n", subscription->ref_count);
ul.unlock_subscription(subscription);

ul.lock_udomain(_d, public_identity);
//finally we update the explicit IMPU record with the new data
if (ul.update_impurecord(_d, public_identity, 0, reg_state, -1 /*do not change send sar on delete */, 0 /*this is explicit so barring must be 0*/, 0, s, ccf1, ccf2, ecf1, ecf2, &impu_rec) != 0) {
LM_ERR("Unable to update explicit impurecord for <%.*s>\n", public_identity->len, public_identity->s);
}

notify_subscribers(impu_rec);
ul.unlock_udomain(_d, public_identity);
break;
case AVP_IMS_SAR_USER_DEREGISTRATION:
/*TODO: if its not a star lets find all the contact records and remove them*/
Expand Down

0 comments on commit 82c42dd

Please sign in to comment.