[sr-dev] git:3.1: mi_datagram: update cfg framework structures in extra MI processes

Daniel-Constantin Mierla miconda at gmail.com
Thu Apr 7 19:31:29 CEST 2011


Module: sip-router
Branch: 3.1
Commit: eb6f5f221a6134e9d8e81e6eaeffd33e76d551a6
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=eb6f5f221a6134e9d8e81e6eaeffd33e76d551a6

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Apr  7 19:17:57 2011 +0200

mi_datagram: update cfg framework structures in extra MI processes
(cherry picked from commit 0baefce396796b02c77c9d9e2b02a63682d02173)

---

 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 e26a55a..6c4dc29 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"
@@ -434,6 +435,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;
 			}




More information about the sr-dev mailing list