Prechádzať zdrojové kódy

dmq_usrloc: lock before adding contact

- reported by GH #440
Daniel-Constantin Mierla 9 rokov pred
rodič
commit
5937b04a98
1 zmenil súbory, kde vykonal 7 pridanie a 4 odobranie
  1. 7 4
      modules/dmq_usrloc/usrloc_sync.c

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