Module: kamailio
Branch: 4.4
Commit: 1a5e83216e8699cab3680ff321a62a9be7c3c85f
URL:
https://github.com/kamailio/kamailio/commit/1a5e83216e8699cab3680ff321a62a9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-07-11T18:01:40+02:00
rtpproxy: init rtpproxy sockets array after allocation
- do not init sockets for PROC_MAIN (for for=yes) and PROC_INIT to
avoid duplicating sockets with child processed
(cherry picked from commit 0fbac693b4d3ed913b64c2d000f27a96903b7e09)
---
Modified: modules/rtpproxy/rtpproxy.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1a5e83216e8699cab3680ff321a62a9…
Patch:
https://github.com/kamailio/kamailio/commit/1a5e83216e8699cab3680ff321a62a9…
---
diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c
index bb644de..80be249 100644
--- a/modules/rtpproxy/rtpproxy.c
+++ b/modules/rtpproxy/rtpproxy.c
@@ -1007,6 +1007,10 @@ child_init(int rank)
if(rtpp_set_list==NULL )
return 0;
+ if(rank==PROC_INIT || (rank==PROC_MAIN && dont_fork==0)) {
+ return 0;
+ }
+
/* Iterate known RTP proxies - create sockets */
mypid = getpid();
@@ -1015,6 +1019,7 @@ child_init(int rank)
LM_ERR("no more pkg memory\n");
return -1;
}
+ memset(rtpp_socks, -1, sizeof(int)*rtpp_no);
for(rtpp_list = rtpp_set_list->rset_first; rtpp_list != 0;
rtpp_list = rtpp_list->rset_next){