From d8fcf78cf9bbad0b822b3368479cea532f11dc83 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 16 Apr 2013 18:09:38 +0100 Subject: [PATCH] Jingle: wait for session-initiate ack, then send candidates There seems to be a race condition in Jitsi: if we send a transport-info full of candidates immediately after sending a session-info, it sometimes seems to miss the candidates we send it. Waiting until after it acks our session-initiate seems to do the trick. This is only visible in an application which only ever sends a single local candidate, immediately after initiating; it is probably masked in Telepathy by new candidates trickling in after the call starts as we get STUN replies. The previous code would call _transmit_candidates when accepting a call, too, but I don't think this is necessary: in the case where the call is incoming, wocky_jingle_content_add_candidate() will tell the transport to send out new candidates as they are added because the state is > EMPTY. https://bugs.freedesktop.org/show_bug.cgi?id=65657 --- wocky/wocky-jingle-session.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wocky/wocky-jingle-session.c b/wocky/wocky-jingle-session.c index 02a96b1..eea37ab 100644 --- a/wocky/wocky-jingle-session.c +++ b/wocky/wocky-jingle-session.c @@ -1921,6 +1921,9 @@ _on_initiate_reply ( priv->remote_ringing = TRUE; g_signal_emit (sess, signals[REMOTE_STATE_CHANGED], 0); } + + /* now all initial contents can transmit their candidates */ + _map_initial_contents (sess, _transmit_candidates, NULL); } else { @@ -2075,9 +2078,6 @@ try_session_initiate_or_accept (WockyJingleSession *sess) msg, NULL, handler, g_object_ref (sess)); g_object_unref (msg); set_state (sess, new_state, 0, NULL); - - /* now all initial contents can transmit their candidates */ - _map_initial_contents (sess, _transmit_candidates, NULL); } /** -- 1.8.2.1