Browse Source

presence_xml: avoid re-init of db handler

- safety check for usage of xmlrpc module for mi cmds
(cherry picked from commit 098deec785ab7c4e927104e83fc84b6c1b347719)
Daniel-Constantin Mierla 15 năm trước cách đây
mục cha
commit
b4b903e1df
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      modules_k/presence_xml/presence_xml.c

+ 4 - 0
modules_k/presence_xml/presence_xml.c

@@ -277,6 +277,8 @@ static int mi_child_init(void)
 		LM_CRIT("database not bound\n");
 		return -1;
 	}
+	if(pxml_db)
+		return 0;
 	pxml_db = pxml_dbf.init(&db_url);
 	if (pxml_db== NULL)
 	{
@@ -310,6 +312,8 @@ static int child_init(int rank)
 		LM_CRIT("database not bound\n");
 		return -1;
 	}
+	if(pxml_db)
+		return 0;
 	pxml_db = pxml_dbf.init(&db_url);
 	if (pxml_db== NULL)
 	{