Module: kamailio
Branch: 4.2
Commit: 2862a7213b6ae5b76b610af707833a61aff1d304
URL:
https://github.com/kamailio/kamailio/commit/2862a7213b6ae5b76b610af707833a6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-29T12:29:11+02:00
kex: fix some pkg.stats value for PROC_NOCHLDINIT rank
- initialization of stats cannot be executed in child_init() for such
case, do it with first rpc request
(cherry picked from commit 6fc4065f56d2d7929494f0e6f3dfcdb80ef0a4ec)
(cherry picked from commit b63dd52685970914e11c670bae5ac6b2191595f1)
---
Modified: modules/kex/pkg_stats.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2862a7213b6ae5b76b610af707833a6…
Patch:
https://github.com/kamailio/kamailio/commit/2862a7213b6ae5b76b610af707833a6…
---
diff --git a/modules/kex/pkg_stats.c b/modules/kex/pkg_stats.c
index 9e87c42..035d528 100644
--- a/modules/kex/pkg_stats.c
+++ b/modules/kex/pkg_stats.c
@@ -33,6 +33,7 @@
#include "../../dprint.h"
#include "../../ut.h"
#include "../../pt.h"
+#include "../../sr_module.h"
#include "../../events.h"
#include "../../mem/mem.h"
#include "../../mem/shm_mem.h"
@@ -234,6 +235,11 @@ static void rpc_pkg_stats(rpc_t* rpc, void* ctx)
rpc->fault(ctx, 500, "Internal error creating rpc");
return;
}
+ if(_pkg_proc_stats_list[i].pid==0) {
+ _pkg_proc_stats_list[i].pid = pt[i].pid;
+ _pkg_proc_stats_list[i].total_size = _pkg_proc_stats_list[0].total_size;
+ _pkg_proc_stats_list[i].rank = PROC_NOCHLDINIT;
+ }
if(rpc->struct_add(th, "dddddddd",
"entry", i,
"pid", _pkg_proc_stats_list[i].pid,