Explorar o código

mi_xmlrpc: update cfg framework structures in extra MI processes

Daniel-Constantin Mierla %!s(int64=14) %!d(string=hai) anos
pai
achega
b1429aef87
Modificáronse 2 ficheiros con 13 adicións e 0 borrados
  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 "../../mem/mem.h"
 #include "../../mem/shm_mem.h"
+#include "../../cfg/cfg_struct.h"
 
 xmlrpc_env env;
 xmlrpc_value * xr_response;
@@ -134,6 +135,9 @@ static int mod_init(void)
 	/* add space for extra processes */
 	register_procs(1);
 
+	/* add child to update local config framework structures */
+	cfg_register_child(1);
+
 	return 0;
 }
 
@@ -146,6 +150,11 @@ static int child_init(int rank)
 			return -1; /* error */
 		if(pid==0){
 			/* child */
+
+			/* initialize the config framework */
+			if (cfg_child_init())
+				return -1;
+
 			xmlrpc_process(1);
 		}
 	}

+ 4 - 0
modules_k/mi_xmlrpc/xr_server.c

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