[Pkg-voip-commits] [janus] 121/282: Check if ice send thread is ended before freeing session. Front push dtls alert message in case of hangup.

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.

commit d401f261fe6c3f18517a45476592aef5fec143f5
Author: Alessandro Toppi <atoppi at meetecho.com>
Date:   Tue Oct 10 12:21:55 2017 +0200

    Check if ice send thread is ended before freeing session. Front push dtls alert message in case of hangup.
---
 ice.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ice.c b/ice.c
index b9b845e..0968bc4 100644
--- a/ice.c
+++ b/ice.c
@@ -446,11 +446,18 @@ static gboolean janus_ice_handles_check(gpointer user_data) {
 			}
 			/* Be sure that iceloop is not running, before freeing */
 			if(handle->iceloop != NULL && g_main_loop_is_running(handle->iceloop)) {
+				JANUS_LOG(LOG_WARN, "Handle %"SCNu64" cleanup delayed because iceloop is still running...\n", handle->handle_id);
 				g_main_loop_quit(handle->iceloop);
 				continue;
 			}
 			/* Be sure that icethread has finished, before freeing*/
 			if(handle->icethread != NULL) {
+				JANUS_LOG(LOG_WARN, "Handle %"SCNu64" cleanup delayed because icethread is still running...\n", handle->handle_id);
+				continue;
+			}
+			/* Be sure that ice send thread has finished, before freeing*/
+			if (g_atomic_int_get(&handle->send_thread_created) && handle->send_thread != NULL) {
+				JANUS_LOG(LOG_WARN, "Handle %"SCNu64" cleanup delayed because icesendthread is still running...\n", handle->handle_id);
 				continue;
 			}
 			/* Schedule the ICE handle for deletion */
@@ -1210,7 +1217,7 @@ void janus_ice_webrtc_hangup(janus_ice_handle *handle, const char *reason) {
 		janus_ice_notify_hangup(handle, reason);
 	}
 	if(handle->queued_packets != NULL)
-		g_async_queue_push(handle->queued_packets, &janus_ice_dtls_alert);
+		g_async_queue_push_front(handle->queued_packets, &janus_ice_dtls_alert);
 	if(handle->send_thread == NULL) {
 		/* Get rid of the loop */
 		if(handle->iceloop != NULL) {
@@ -4002,6 +4009,7 @@ void *janus_ice_send_thread(void *data) {
 	}
 	JANUS_LOG(LOG_VERB, "[%"SCNu64"] ICE send thread leaving...\n", handle->handle_id);
 	g_thread_unref(g_thread_self());
+	handle->send_thread = NULL;
 	return NULL;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list