Skip to content

Commit

Permalink
rtpproxy: init rtpproxy sockets array after allocation
Browse files Browse the repository at this point in the history
- do not init sockets for PROC_MAIN (for for=yes) and PROC_INIT to
  avoid duplicating sockets with child processed
  • Loading branch information
miconda committed Jul 7, 2016
1 parent d76761b commit 0fbac69
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/rtpproxy/rtpproxy.c
Expand Up @@ -862,6 +862,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();

Expand All @@ -870,6 +874,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){
Expand Down

0 comments on commit 0fbac69

Please sign in to comment.