瀏覽代碼

mi_xmlrpc: update cfg framework structures in extra MI processes

Daniel-Constantin Mierla 14 年之前
父節點
當前提交
b1429aef87
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. 9 0
      modules_k/mi_xmlrpc/mi_xmlrpc.c
  2. 4 0
      modules_k/mi_xmlrpc/xr_server.c

+ 9 - 0
modules_k/mi_xmlrpc/mi_xmlrpc.c

@@ -65,6 +65,7 @@
 #include "../../pt.h"
 #include "../../pt.h"
 #include "../../mem/mem.h"
 #include "../../mem/mem.h"
 #include "../../mem/shm_mem.h"
 #include "../../mem/shm_mem.h"
+#include "../../cfg/cfg_struct.h"
 
 
 xmlrpc_env env;
 xmlrpc_env env;
 xmlrpc_value * xr_response;
 xmlrpc_value * xr_response;
@@ -134,6 +135,9 @@ static int mod_init(void)
 	/* add space for extra processes */
 	/* add space for extra processes */
 	register_procs(1);
 	register_procs(1);
 
 
+	/* add child to update local config framework structures */
+	cfg_register_child(1);
+
 	return 0;
 	return 0;
 }
 }
 
 
@@ -146,6 +150,11 @@ static int child_init(int rank)
 			return -1; /* error */
 			return -1; /* error */
 		if(pid==0){
 		if(pid==0){
 			/* child */
 			/* child */
+
+			/* initialize the config framework */
+			if (cfg_child_init())
+				return -1;
+
 			xmlrpc_process(1);
 			xmlrpc_process(1);
 		}
 		}
 	}
 	}

+ 4 - 0
modules_k/mi_xmlrpc/xr_server.c

@@ -35,6 +35,7 @@
 #include "../../mem/shm_mem.h"
 #include "../../mem/shm_mem.h"
 #include "../../locking.h"
 #include "../../locking.h"
 #include "../../ut.h"
 #include "../../ut.h"
+#include "../../cfg/cfg_struct.h"
 #include "xr_writer.h"
 #include "xr_writer.h"
 #include "xr_parser.h"
 #include "xr_parser.h"
 #include "mi_xmlrpc.h"
 #include "mi_xmlrpc.h"
@@ -177,6 +178,9 @@ xmlrpc_value*  default_method	(xmlrpc_env* 	env,
 
 
 	LM_DBG("starting up.....\n");
 	LM_DBG("starting up.....\n");
 
 
+	/* update the local config framework structures */
+	cfg_update();
+
 	f = lookup_mi_cmd((char*)methodName, strlen(methodName));
 	f = lookup_mi_cmd((char*)methodName, strlen(methodName));
 	
 	
 	if ( f == 0 ) {
 	if ( f == 0 ) {