Skip to content

Commit

Permalink
freeswitch: Avoid failed "unref" operations during mod init
Browse files Browse the repository at this point in the history
This fixes a bug where if a FreeSWITCH socket were defined in both
modparam and DB, it would get a +2 ref instead of +1, thus after a DB
removal + reload operation it would remain in a dangling state.

Many thanks to Five9 (https://www.five9.com) for reporting this issue!
  • Loading branch information
liviuchircu committed Feb 12, 2024
1 parent 93e90a5 commit 6e6c60b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/freeswitch/fs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "../../forward.h"
#include "../../ut.h"
#include "../../lib/url.h"
#include "../../status_report.h"

#include "fs_api.h"
#include "fs_ipc.h"
Expand Down Expand Up @@ -584,7 +585,7 @@ void put_evs(fs_evs *sock)
* possible, since the main process brutally murders the FS connection
* manager before it gets a chance to gracefully EOF its TCP connections.
*/
if (is_main)
if (sr_get_core_status() == STATE_TERMINATING)
return;

lock_start_write(sockets_lock);
Expand Down

0 comments on commit 6e6c60b

Please sign in to comment.