Module: sip-router
Branch: 3.1
Commit: 2e9113a87be66da3e2f0119d20095777ecd32223
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2e9113a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Apr 10 12:18:44 2011 +0200
xmpp(k): enable cfg framework for module's extra process
(cherry picked from commit cd3d112dcd6b0c5dd6e66fabc8082b70dcb317ae)
---
modules_k/xmpp/xmpp.c | 8 +++++++-
modules_k/xmpp/xmpp_component.c | 4 ++++
modules_k/xmpp/xmpp_server.c | 5 +++++
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/modules_k/xmpp/xmpp.c b/modules_k/xmpp/xmpp.c
index e7a0093..ad087e4 100644
--- a/modules_k/xmpp/xmpp.c
+++ b/modules_k/xmpp/xmpp.c
@@ -118,6 +118,7 @@
#include "../../parser/parse_content.h"
#include "../../parser/parse_from.h"
#include "../../modules/tm/tm_load.h"
+#include "../../cfg/cfg_struct.h"
#include "xode.h"
#include "xmpp.h"
@@ -245,7 +246,8 @@ static int mod_init(void) {
/* add space for one extra process */
register_procs(1);
-
+ /* add child to update local config framework structures */
+ cfg_register_child(1);
return 0;
}
@@ -263,6 +265,10 @@ static int child_init(int rank)
return -1; /* error */
if(pid==0){
/* child */
+ /* initialize the config framework */
+ if (cfg_child_init())
+ return -1;
+
xmpp_process(1);
}
}
diff --git a/modules_k/xmpp/xmpp_component.c b/modules_k/xmpp/xmpp_component.c
index e93b040..123f11a 100644
--- a/modules_k/xmpp/xmpp_component.c
+++ b/modules_k/xmpp/xmpp_component.c
@@ -49,6 +49,7 @@
#include <string.h>
#include "../../sr_module.h"
+#include "../../cfg/cfg_struct.h"
#include "xmpp.h"
#include "xmpp_api.h"
@@ -221,6 +222,9 @@ int xmpp_component_child_process(int data_pipe)
maxfd = fd > data_pipe ? fd : data_pipe;
rv = select(maxfd + 1, &fdset, NULL, NULL, NULL);
+ /* update the local config framework structures */
+ cfg_update();
+
if (rv < 0) {
LM_ERR("select() failed: %s\n", strerror(errno));
} else if (!rv) {
diff --git a/modules_k/xmpp/xmpp_server.c b/modules_k/xmpp/xmpp_server.c
index 74b82a3..cc355b4 100644
--- a/modules_k/xmpp/xmpp_server.c
+++ b/modules_k/xmpp/xmpp_server.c
@@ -91,6 +91,7 @@
#include <string.h>
#include "../../sr_module.h"
+#include "../../cfg/cfg_struct.h"
#include "xmpp.h"
#include "xmpp_api.h"
@@ -497,6 +498,10 @@ int xmpp_server_child_process(int data_pipe)
}
rv = select(FD_SETSIZE, &fdset, NULL, NULL, NULL);
+
+ /* update the local config framework structures */
+ cfg_update();
+
if (rv < 0) {
LM_ERR("select() failed: %s\n", strerror(errno));
} else if (!rv) {