From 63f5f8c89d46ce5bbb100d9f1de39a7bf37e9e92 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 8 Sep 2021 10:47:34 +0200 Subject: [PATCH] modify TODOs in JingleRtpConnection upon better understanding of the WebRTC stack --- .../xmpp/jingle/JingleRtpConnection.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index 67c32d72a..6afcff336 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -1038,6 +1038,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web return RtpEndUserState.CONNECTING; } case SESSION_ACCEPTED: + //TODO refactor this out into separate method (that uses switch for better readability) final PeerConnection.PeerConnectionState state; try { state = webRTCWrapper.getState(); @@ -1340,9 +1341,13 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web if (newState == PeerConnection.PeerConnectionState.CLOSED && this.rtpConnectionEnded == 0) { this.rtpConnectionEnded = SystemClock.elapsedRealtime(); } - //TODO 'DISCONNECTED' might be an opportunity to renew the offer and send a transport-replace - //TODO exact syntax is yet to be determined but transport-replace sounds like the most reasonable - //as there is no content-replace + //TODO 'failed' means we need to restart ICE + // + //TODO 'disconnected' can probably be ignored as "This is a less stringent test than failed + // and may trigger intermittently and resolve just as spontaneously on less reliable networks, + // or during temporary disconnections. When the problem resolves, the connection may return + // to the connected state." + // Obviously the UI needs to reflect this new state with a 'reconnecting' display or something if (Arrays.asList(PeerConnection.PeerConnectionState.FAILED, PeerConnection.PeerConnectionState.DISCONNECTED).contains(newState)) { if (isTerminated()) { Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": not sending session-terminate after connectivity error because session is already in state " + this.state);