Explorar o código

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 %!s(int64=15) %!d(string=hai) anos
pai
achega
b4b903e1df
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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)
 	{