do not throw when finishing jingle ft twice. fixes #3765

the state machine in jingle file transfer does not prevent that the connection
is being finished twice
This commit is contained in:
Daniel Gultsch 2020-06-07 14:59:55 +02:00
parent b78d45c7cc
commit 1853242c66
2 changed files with 5 additions and 1 deletions

View file

@ -447,6 +447,10 @@ public class JingleConnectionManager extends AbstractConnectionManager {
} }
void finishConnection(final AbstractJingleConnection connection) { void finishConnection(final AbstractJingleConnection connection) {
this.connections.remove(connection.getId());
}
void finishConnectionOrThrow(final AbstractJingleConnection connection) {
final AbstractJingleConnection.Id id = connection.getId(); final AbstractJingleConnection.Id id = connection.getId();
if (this.connections.remove(id) == null) { if (this.connections.remove(id) == null) {
throw new IllegalStateException(String.format("Unable to finish connection with id=%s", id.toString())); throw new IllegalStateException(String.format("Unable to finish connection with id=%s", id.toString()));

View file

@ -1189,7 +1189,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
if (isTerminated()) { if (isTerminated()) {
this.cancelRingingTimeout(); this.cancelRingingTimeout();
this.webRTCWrapper.verifyClosed(); this.webRTCWrapper.verifyClosed();
this.jingleConnectionManager.finishConnection(this); this.jingleConnectionManager.finishConnectionOrThrow(this);
} else { } else {
throw new IllegalStateException(String.format("Unable to call finish from %s", this.state)); throw new IllegalStateException(String.format("Unable to call finish from %s", this.state));
} }