Module: kamailio
Branch: master
Commit: 3c1851ad546f574d1fda869348c8f7e5186079d2
URL:
https://github.com/kamailio/kamailio/commit/3c1851ad546f574d1fda869348c8f7e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-02-25T09:13:08+01:00
app_jsdt: skip child init for proc_init rank
---
Modified: src/modules/app_jsdt/app_jsdt_api.c
Modified: src/modules/app_jsdt/app_jsdt_api.h
Modified: src/modules/app_jsdt/app_jsdt_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3c1851ad546f574d1fda869348c8f7e…
Patch:
https://github.com/kamailio/kamailio/commit/3c1851ad546f574d1fda869348c8f7e…
---
diff --git a/src/modules/app_jsdt/app_jsdt_api.c b/src/modules/app_jsdt/app_jsdt_api.c
index 9d4711cc6f..a3c1026a3a 100644
--- a/src/modules/app_jsdt/app_jsdt_api.c
+++ b/src/modules/app_jsdt/app_jsdt_api.c
@@ -456,7 +456,7 @@ int jsdt_kemi_load_script(void)
/**
*
*/
-int jsdt_sr_init_child(void)
+int jsdt_sr_init_child(int rank)
{
memset(&_sr_J_env, 0, sizeof(sr_jsdt_env_t));
_sr_J_env.J = duk_create_heap_default();
@@ -1692,4 +1692,4 @@ duk_ret_t cb_load_module(duk_context *JJ) {
return duk_generic_error(JJ, "Could not load module '%s'",
resolved_id);
}
return 1; /*nrets*/
-}
\ No newline at end of file
+}
diff --git a/src/modules/app_jsdt/app_jsdt_api.h b/src/modules/app_jsdt/app_jsdt_api.h
index 4b0f1ca169..a03d1e6ddf 100644
--- a/src/modules/app_jsdt/app_jsdt_api.h
+++ b/src/modules/app_jsdt/app_jsdt_api.h
@@ -27,7 +27,7 @@
#include "duktape.h"
int jsdt_sr_init_mod(void);
-int jsdt_sr_init_child(void);
+int jsdt_sr_init_child(int rank);
void jsdt_sr_destroy(void);
int jsdt_sr_initialized(void);
diff --git a/src/modules/app_jsdt/app_jsdt_mod.c b/src/modules/app_jsdt/app_jsdt_mod.c
index 4245d2e77c..526376a1d5 100644
--- a/src/modules/app_jsdt/app_jsdt_mod.c
+++ b/src/modules/app_jsdt/app_jsdt_mod.c
@@ -117,7 +117,10 @@ static int mod_init(void)
*/
static int child_init(int rank)
{
- return jsdt_sr_init_child();
+ if(rank==PROC_INIT) {
+ return 0;
+ }
+ return jsdt_sr_init_child(rank);
}
/**