Revision 78955474 plugins/janus_echotest.c

View differences:

plugins/janus_echotest.c
177 177
	gboolean video_active;
178 178
	uint64_t bitrate;
179 179
	guint16 slowlink_count;
180
	guint64 destroyed;	/* Time at which this session was marked as destroyed */
180
	gboolean hangingup;
181
	gint64 destroyed;	/* Time at which this session was marked as destroyed */
181 182
} janus_echotest_session;
182 183
static GHashTable *sessions;
183 184
static GList *old_sessions;
......
588 589
		JANUS_LOG(LOG_ERR, "No session associated with this handle...\n");
589 590
		return;
590 591
	}
591
	if(session->destroyed)
592
	if(session->destroyed || session->hangingup)
592 593
		return;
594
	session->hangingup = TRUE;
593 595
	/* Send an event to the browser and tell it's over */
594 596
	json_t *event = json_object();
595 597
	json_object_set_new(event, "echotest", json_string("event"));
......
604 606
	session->audio_active = TRUE;
605 607
	session->video_active = TRUE;
606 608
	session->bitrate = 0;
609
	/* Done */
610
	session->hangingup = FALSE;
607 611
}
608 612

  
609 613
/* Thread to handle incoming messages */

Also available in: Unified diff