[sr-dev] git:master:5937b04a: dmq_usrloc: lock before adding contact

Daniel-Constantin Mierla miconda at gmail.com
Mon Dec 21 14:50:50 CET 2015


Module: kamailio
Branch: master
Commit: 5937b04a98204fc70ce6db2eab08c038a3497c2a
URL: https://github.com/kamailio/kamailio/commit/5937b04a98204fc70ce6db2eab08c038a3497c2a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/5937b04a98204fc70ce6db2eab08c038a3497c2a.diff
Patch: https://github.com/kamailio/kamailio/commit/5937b04a98204fc70ce6db2eab08c038a3497c2a.patch

---

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");




More information about the sr-dev mailing list