From 5af4c865a72c47faa953573e12c6ceb9212a1358 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 8 May 2020 17:22:27 +0200 Subject: [PATCH] make sure we finsh() the connection after transitioning into terminal state --- .../conversations/xmpp/jingle/JingleRtpConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 f74c738b8..01840189a 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -647,6 +647,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web //todo we haven’t actually initiated the session yet; so sending sessionTerminate makes no sense //todo either we don’t ring ever at all or maybe we should send a retract or something transitionOrThrow(State.TERMINATED_APPLICATION_FAILURE); + this.finish();; return; } try { @@ -662,6 +663,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web sendSessionTerminate(Reason.FAILED_APPLICATION); } else { transitionOrThrow(State.TERMINATED_APPLICATION_FAILURE); + this.finish(); } } } @@ -878,8 +880,8 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": ending call while in state PROCEED just means ending the connection"); this.jingleConnectionManager.endSession(id, State.TERMINATED_SUCCESS); this.webRTCWrapper.close(); - this.finish(); transitionOrThrow(State.TERMINATED_SUCCESS); //arguably this wasn't success; but not a real failure either + this.finish(); return; } if (isInitiator() && isInState(State.SESSION_INITIALIZED, State.SESSION_INITIALIZED_PRE_APPROVED)) { @@ -1180,7 +1182,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web return this.state; } - public boolean isTerminated() { + boolean isTerminated() { return TERMINATED.contains(this.state); }