~singpolyma/cheogram-android

67e5f839f11f0c458287d9e7e679317e0ece3e50 — Daniel Gultsch 2 years ago 89012b0
ignore crypto callbacks when rtp session has already been terminated
1 files changed, 14 insertions(+), 0 deletions(-)

M src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java
M src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java => src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +14 -0
@@ 540,6 540,9 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
    }

    private void failureToAcceptSession(final Throwable throwable) {
        if (isTerminated()) {
            return;
        }
        Log.d(Config.LOGTAG, "unable to send session accept", Throwables.getRootCause(throwable));
        webRTCWrapper.close();
        sendSessionTerminate(Reason.ofThrowable(throwable));


@@ 574,6 577,10 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
    }

    private void sendSessionAccept(final RtpContentMap rtpContentMap, final org.webrtc.SessionDescription webRTCSessionDescription) {
        if (isTerminated()) {
            Log.w(Config.LOGTAG, id.account.getJid().asBareJid() + ": preparing session accept was too slow. already terminated. nothing to do.");
            return;
        }
        transitionOrThrow(State.SESSION_ACCEPTED);
        final JinglePacket sessionAccept = rtpContentMap.toJinglePacket(JinglePacket.Action.SESSION_ACCEPT, id.sessionId);
        send(sessionAccept);


@@ 837,6 844,9 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
    }

    private void failureToInitiateSession(final Throwable throwable, final State targetState) {
        if (isTerminated()) {
            return;
        }
        Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": unable to sendSessionInitiate", Throwables.getRootCause(throwable));
        webRTCWrapper.close();
        final Reason reason = Reason.ofThrowable(throwable);


@@ 873,6 883,10 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
    }

    private void sendSessionInitiate(final RtpContentMap rtpContentMap, final org.webrtc.SessionDescription webRTCSessionDescription, final State targetState) {
        if (isTerminated()) {
            Log.w(Config.LOGTAG, id.account.getJid().asBareJid() + ": preparing session was too slow. already terminated. nothing to do.");
            return;
        }
        this.transitionOrThrow(targetState);
        final JinglePacket sessionInitiate = rtpContentMap.toJinglePacket(JinglePacket.Action.SESSION_INITIATE, id.sessionId);
        send(sessionInitiate);