Module: kamailio
Branch: master
Commit: 5937b04a98204fc70ce6db2eab08c038a3497c2a
URL:
https://github.com/kamailio/kamailio/commit/5937b04a98204fc70ce6db2eab08c03…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-12-21T14:48:25+01:00
dmq_usrloc: lock before adding contact
- reported by GH #440
---
Modified: modules/dmq_usrloc/usrloc_sync.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5937b04a98204fc70ce6db2eab08c03…
Patch:
https://github.com/kamailio/kamailio/commit/5937b04a98204fc70ce6db2eab08c03…
---
diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c
index 15da075..f89500d 100644
--- a/modules/dmq_usrloc/usrloc_sync.c
+++ b/modules/dmq_usrloc/usrloc_sync.c
@@ -56,10 +56,13 @@ static int add_contact(str aor, ucontact_info_t* ci)
str contact;
int res;
- if (dmq_ul.get_udomain("location", &_d) < 0) {
- LM_ERR("Failed to get domain\n");
- return -1;
- }
+ if (dmq_ul.get_udomain("location", &_d) < 0) {
+ LM_ERR("Failed to get domain\n");
+ return -1;
+ }
+
+ dmq_ul.lock_udomain(_d, &aor);
+
res = dmq_ul.get_urecord(_d, &aor, &r);
if (res < 0) {
LM_ERR("failed to retrieve record from usrloc\n");