[sr-dev] git:3.1: seas(k): enable cfg framework for module's extra process

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 11 12:37:08 CEST 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Apr 10 12:47:55 2011 +0200

seas(k): enable cfg framework for module's extra process
(cherry picked from commit 4990dea6ab31e9d0aec78ca09af96a481196cd70)

---

 modules_k/seas/event_dispatcher.c |    4 ++++
 modules_k/seas/seas.c             |    8 ++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/modules_k/seas/event_dispatcher.c b/modules_k/seas/event_dispatcher.c
index 7702c58..7f8cbb3 100644
--- a/modules_k/seas/event_dispatcher.c
+++ b/modules_k/seas/event_dispatcher.c
@@ -38,6 +38,7 @@
 #include "../../mem/shm_mem.h" /*shm_malloc*/
 #include "../../dprint.h" /*LM_**/
 #include "../../locking.h"
+#include "../../cfg/cfg_struct.h"
 
 #include "seas.h"
 #include "ha.h"
@@ -129,6 +130,9 @@ int dispatcher_main_loop(void)
       spawn_pinger();
 
    while(1){
+		/* update the local config framework structures */
+		cfg_update();
+
       if(sig_flag==SIGCHLD){
 	 while ((chld=waitpid( -1, &chld_status, WNOHANG ))>0) {
 	    if (WIFEXITED(chld_status)){
diff --git a/modules_k/seas/seas.c b/modules_k/seas/seas.c
index b1adb9d..c68bffa 100644
--- a/modules_k/seas/seas.c
+++ b/modules_k/seas/seas.c
@@ -37,6 +37,7 @@
 #include "../../modules/tm/tm_load.h" /*load_tm_api*/
 #include "../../modules/tm/h_table.h" /*cell*/
 #include "../../modules/tm/t_lookup.h" /*T_UNDEFINED*/
+#include "../../cfg/cfg_struct.h"
 
 #include "encode_msg.h" /*encode_msg*/
 
@@ -681,6 +682,9 @@ static int seas_init(void)
    if(0>parse_cluster_cfg())
       goto error;
    register_procs(1);
+	/* add child to update local config framework structures */
+	cfg_register_child(1);
+
    return 0;
 error:
    for(i=0;i<2;i++)
@@ -728,6 +732,10 @@ static int seas_child_init(int rank)
       /*dispatcher child. we leave writing end open so that new childs spawned
        * by event dispatcher can also write to pipe.. */
 
+		/* initialize the config framework */
+		if (cfg_child_init())
+			return -1;
+
       /* close(write_pipe); */
       return dispatcher_main_loop();
    }




More information about the sr-dev mailing list