Module: sip-router
Branch: master
Commit: 0baefce396796b02c77c9d9e2b02a63682d02173
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0baefce…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Apr 7 19:17:57 2011 +0200
mi_datagram: update cfg framework structures in extra MI processes
---
modules_k/mi_datagram/datagram_fnc.c | 4 ++++
modules_k/mi_datagram/mi_datagram.c | 8 ++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/modules_k/mi_datagram/datagram_fnc.c b/modules_k/mi_datagram/datagram_fnc.c
index 72cdff9..e93949a 100644
--- a/modules_k/mi_datagram/datagram_fnc.c
+++ b/modules_k/mi_datagram/datagram_fnc.c
@@ -48,6 +48,7 @@
#include <signal.h>
#include "../../resolve.h"
+#include "../../cfg/cfg_struct.h"
#include "mi_datagram.h"
#include "datagram_fnc.h"
#include "mi_datagram_parser.h"
@@ -435,6 +436,9 @@ void mi_datagram_server(int rx_sock, int tx_sock)
f = 0;
while(1) { /*read the datagram*/
+ /* update the local config framework structures */
+ cfg_update();
+
memset(mi_buf, 0, DATAGRAM_SOCK_BUF_SIZE);
reply_addr_len = sizeof(reply_addr);
diff --git a/modules_k/mi_datagram/mi_datagram.c b/modules_k/mi_datagram/mi_datagram.c
index e45cee2..0e2f303 100644
--- a/modules_k/mi_datagram/mi_datagram.c
+++ b/modules_k/mi_datagram/mi_datagram.c
@@ -56,6 +56,7 @@
#include "../../lib/kmi/mi.h"
#include "../../ip_addr.h"
#include "../../pt.h"
+#include "../../cfg/cfg_struct.h"
#include "mi_datagram.h"
#include "datagram_fnc.h"
#include "mi_datagram_parser.h"
@@ -253,6 +254,8 @@ static int mi_mod_init(void)
done:
/* add space for extra processes */
register_procs(mi_procs[0].no);
+ /* add child to update local config framework structures */
+ cfg_register_child(mi_procs[0].no);
return 0;
}
@@ -282,6 +285,11 @@ static int mi_child_init(int rank)
return -1; /* error */
if(pid==0) {
/* child */
+
+ /* initialize the config framework */
+ if (cfg_child_init())
+ return -1;
+
datagram_process(i);
return 0;
}