[Pkg-voip-commits] [janus] 153/282: Made RTCP BYE management more tolerant, to accomodate older Firefox 52

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:36 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 0c4aa227f24e452428e1181e6c771364f7a59f64
Author: Lorenzo Miniero <lminiero at gmail.com>
Date:   Tue Oct 24 18:02:27 2017 +0200

    Made RTCP BYE management more tolerant, to accomodate older Firefox 52
---
 ice.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/ice.c b/ice.c
index c8e2a57..0e6ef49 100644
--- a/ice.c
+++ b/ice.c
@@ -2247,9 +2247,19 @@ static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint comp
 						"[session=%"SCNu64"][handle=%"SCNu64"]", session->session_id, handle->handle_id);
 				/* Check if there's an RTCP BYE: in case, let's wrap up */
 				if(janus_rtcp_has_bye(buf, buflen)) {
-					JANUS_LOG(LOG_VERB, "[%"SCNu64"] Got RTCP BYE on stream %"SCNu16" (component %"SCNu16"), closing...\n", handle->handle_id, stream->stream_id, component->component_id);
-					janus_ice_webrtc_hangup(handle, "RTCP BYE");
-					return;
+					/* Firefox 52 sends a broken BYE as part of its first compound packet: to
+					 * "fix" this, we check if we got a BYE too soon, and in case ignore it */
+					gint64 now = janus_get_monotonic_time();
+					if(now - component->dtls->dtls_connected < 500000) {
+						JANUS_LOG(LOG_WARN, "[%"SCNu64"] Got RTCP BYE on stream %"SCNu16" (component %"SCNu16"), but it arrived too soon, ignoring...\n",
+							handle->handle_id, stream->stream_id, component->component_id);
+						/* FIXME Should we remove the BYE from the compound packet? */
+					} else {
+						/* Looks like it's a real BYE: hangup the PeerConnection */
+						JANUS_LOG(LOG_VERB, "[%"SCNu64"] Got RTCP BYE on stream %"SCNu16" (component %"SCNu16"), closing...\n", handle->handle_id, stream->stream_id, component->component_id);
+						janus_ice_webrtc_hangup(handle, "RTCP BYE");
+						return;
+					}
 				}
 				/* Is this audio or video? */
 				int video = 0;

-- 
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