[Pkg-voip-commits] [janus] 253/282: Fix not initialized old_rooms in janus_textroom_destroy. Re-evaluate as needed 'now' timestamp in textroom and streaming watchdog.

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:46 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 ec3a3a363d338947adde7a84369c9e74df1f6e2f
Author: Alessandro Toppi <atoppi at meetecho.com>
Date:   Mon Dec 11 12:50:04 2017 +0100

    Fix not initialized old_rooms in janus_textroom_destroy. Re-evaluate as needed 'now' timestamp in textroom and streaming watchdog.
---
 plugins/janus_streaming.c |  1 +
 plugins/janus_textroom.c  | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/plugins/janus_streaming.c b/plugins/janus_streaming.c
index f99bc9f..2703334 100644
--- a/plugins/janus_streaming.c
+++ b/plugins/janus_streaming.c
@@ -610,6 +610,7 @@ static void *janus_streaming_watchdog(void *data) {
 		/* Iterate on all the mountpoints */
 		if(old_mountpoints != NULL) {
 			GList *sl = old_mountpoints;
+			now = janus_get_monotonic_time();
 			JANUS_LOG(LOG_HUGE, "Checking %d old Streaming mountpoints...\n", g_list_length(old_mountpoints));
 			while(sl) {
 				janus_streaming_mountpoint *mountpoint = (janus_streaming_mountpoint *)sl->data;
diff --git a/plugins/janus_textroom.c b/plugins/janus_textroom.c
index 1f220a7..25d4561 100644
--- a/plugins/janus_textroom.c
+++ b/plugins/janus_textroom.c
@@ -331,6 +331,7 @@ static void *janus_textroom_watchdog(void *data) {
 		if(old_rooms != NULL) {
 			GList *rl = old_rooms;
 			now = janus_get_monotonic_time();
+			JANUS_LOG(LOG_HUGE, "Checking %d old Textrooms...\n", g_list_length(old_rooms));
 			while(rl) {
 				janus_textroom_room *textroom = (janus_textroom_room*)rl->data;
 				if(!g_atomic_int_get(&initialized) || g_atomic_int_get(&stopping)){
@@ -538,6 +539,19 @@ void janus_textroom_destroy(void) {
 		g_thread_join(handler_thread);
 		handler_thread = NULL;
 	}
+	/* Remove all textrooms */
+	janus_mutex_lock(&rooms_mutex);
+	GHashTableIter iter;
+	gpointer value;
+	g_hash_table_iter_init(&iter, rooms);
+	while(g_hash_table_iter_next(&iter, NULL, &value)) {
+		janus_textroom_room *room = value;
+		if(!room->destroyed) {
+			room->destroyed = janus_get_monotonic_time();
+			old_rooms = g_list_append(old_rooms, room);
+		}
+	}
+	janus_mutex_unlock(&rooms_mutex);
 	if(watchdog != NULL) {
 		g_thread_join(watchdog);
 		watchdog = 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