From 5b3c52c50b5301d009fb9a0d44b4cf91d50f6de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 13 Jun 2025 22:49:29 +0200 Subject: Terminate ICE thread when server is stopped Changelog: Improved handling of ICE connections --- src/Erebos/ICE/pjproject.c | 7 +++++++ src/Erebos/ICE/pjproject.h | 1 + 2 files changed, 8 insertions(+) (limited to 'src/Erebos/ICE') diff --git a/src/Erebos/ICE/pjproject.c b/src/Erebos/ICE/pjproject.c index 54da58d..e9446fe 100644 --- a/src/Erebos/ICE/pjproject.c +++ b/src/Erebos/ICE/pjproject.c @@ -216,6 +216,13 @@ void ice_cfg_free( struct erebos_ice_cfg * ecfg ) free( ecfg ); } +void ice_cfg_stop_thread( struct erebos_ice_cfg * ecfg ) +{ + if( ! ecfg ) + return; + ecfg->exit = true; +} + pj_ice_strans * ice_create( const struct erebos_ice_cfg * ecfg, pj_ice_sess_role role, HsStablePtr sptr, HsStablePtr cb ) { diff --git a/src/Erebos/ICE/pjproject.h b/src/Erebos/ICE/pjproject.h index 1d20891..c31e227 100644 --- a/src/Erebos/ICE/pjproject.h +++ b/src/Erebos/ICE/pjproject.h @@ -6,6 +6,7 @@ struct erebos_ice_cfg * ice_cfg_create( const char * stun_server, uint16_t stun_port, const char * turn_server, uint16_t turn_port ); void ice_cfg_free( struct erebos_ice_cfg * cfg ); +void ice_cfg_stop_thread( struct erebos_ice_cfg * cfg ); pj_ice_strans * ice_create( const struct erebos_ice_cfg *, pj_ice_sess_role role, HsStablePtr sptr, HsStablePtr cb ); -- cgit v1.2.3