Module: kamailio
Branch: master
Commit: bb14964dd8337d0946c7e233ff3cc81f22e8e1bb
URL:
https://github.com/kamailio/kamailio/commit/bb14964dd8337d0946c7e233ff3cc81…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-22T19:54:51+02:00
jsonrpcc: init and update cfg framework for io handler process
- GH #1520
---
Modified: src/modules/jsonrpcc/jsonrpc_io.c
Modified: src/modules/jsonrpcc/jsonrpcc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/bb14964dd8337d0946c7e233ff3cc81…
Patch:
https://github.com/kamailio/kamailio/commit/bb14964dd8337d0946c7e233ff3cc81…
---
diff --git a/src/modules/jsonrpcc/jsonrpc_io.c b/src/modules/jsonrpcc/jsonrpc_io.c
index cae18322ba..ebb93348ba 100644
--- a/src/modules/jsonrpcc/jsonrpc_io.c
+++ b/src/modules/jsonrpcc/jsonrpc_io.c
@@ -33,6 +33,8 @@
#include "../../core/route.h"
#include "../../core/route_struct.h"
#include "../../core/lvalue.h"
+#include "../../core/cfg/cfg_struct.h"
+
#include "../tm/tm_load.h"
#include "jsonrpc_io.h"
@@ -156,6 +158,8 @@ void cmd_pipe_cb(int fd, short event, void *arg)
return;
}
+ cfg_update();
+
params = json_tokener_parse(cmd->params);
if (cmd->notify_only) {
diff --git a/src/modules/jsonrpcc/jsonrpcc_mod.c b/src/modules/jsonrpcc/jsonrpcc_mod.c
index 903b278447..2c3cce22db 100644
--- a/src/modules/jsonrpcc/jsonrpcc_mod.c
+++ b/src/modules/jsonrpcc/jsonrpcc_mod.c
@@ -28,6 +28,8 @@
#include "../../core/mod_fix.h"
#include "../../core/trim.h"
#include "../../core/sr_module.h"
+#include "../../core/cfg/cfg_struct.h"
+
#include "../tm/tm_load.h"
#include "jsonrpc_request.h"
@@ -139,6 +141,9 @@ static int child_init(int rank)
if(pid==0){
/* child */
close(pipe_fds[1]);
+ /* initialize the config framework */
+ if (cfg_child_init())
+ return -1;
return jsonrpc_io_child_process(pipe_fds[0], servers_param);
}
return 0;