Module: kamailio Branch: 5.6 Commit: 824867fd1f81c78cc0fd8c688aa4032c24e49781 URL: https://github.com/kamailio/kamailio/commit/824867fd1f81c78cc0fd8c688aa4032c...
Author: Anthony Alba ascanio.alba7@gmail.com Committer: Anthony Alba ascanio.alba7@gmail.com Date: 2022-06-10T22:20:06+08:00
app_python3: use _ksr_is_main to detect child process
(cherry picked from commit 8683deb20a)
---
Modified: src/modules/app_python3/app_python3_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/824867fd1f81c78cc0fd8c688aa4032c... Patch: https://github.com/kamailio/kamailio/commit/824867fd1f81c78cc0fd8c688aa4032c...
---
diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c index d250640e0c..376d1c1312 100644 --- a/src/modules/app_python3/app_python3_mod.c +++ b/src/modules/app_python3/app_python3_mod.c @@ -185,9 +185,6 @@ static int child_init(int rank) * this is called before any process is forked * so the Python internal state handler * should be called now. - * - * TODO: is PyOS_AfterFork_Parent() necesary - * in the main process? */ #if PY_VERSION_HEX >= 0x03070000 PyOS_BeforeFork() ; @@ -206,7 +203,7 @@ static int child_init(int rank) } _apy_process_rank = rank;
- if (rank > 0) { + if (!_ksr_is_main) { #if PY_VERSION_HEX >= 0x03070000 PyOS_AfterFork_Child(); #else