respond OK to JFT session terminate

This commit is contained in:
Daniel Gultsch 2024-01-19 10:40:32 +01:00
parent aa558f83f2
commit 15a3c163eb
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -556,6 +556,7 @@ public class JingleFileTransferConnection extends AbstractJingleConnection
} }
private void receiveSessionTerminate(final JinglePacket jinglePacket) { private void receiveSessionTerminate(final JinglePacket jinglePacket) {
respondOk(jinglePacket);
final JinglePacket.ReasonWrapper wrapper = jinglePacket.getReason(); final JinglePacket.ReasonWrapper wrapper = jinglePacket.getReason();
final State previous = this.state; final State previous = this.state;
Log.d( Log.d(
@ -745,16 +746,17 @@ public class JingleFileTransferConnection extends AbstractJingleConnection
private void receiveTransportReplace( private void receiveTransportReplace(
final JinglePacket jinglePacket, final GenericTransportInfo transportInfo) { final JinglePacket jinglePacket, final GenericTransportInfo transportInfo) {
respondOk(jinglePacket); respondOk(jinglePacket);
final Transport transport; // TODO kill current transport
final Transport nextTransport;
try { try {
transport = setupTransport(transportInfo); nextTransport = setupTransport(transportInfo);
} catch (final RuntimeException e) { } catch (final RuntimeException e) {
sendSessionTerminate(Reason.of(e), e.getMessage()); sendSessionTerminate(Reason.of(e), e.getMessage());
return; return;
} }
this.transport = transport; this.transport = nextTransport;
this.transport.setTransportCallback(this); this.transport.setTransportCallback(this);
final var transportInfoFuture = transport.asTransportInfo(); final var transportInfoFuture = nextTransport.asTransportInfo();
Futures.addCallback( Futures.addCallback(
transportInfoFuture, transportInfoFuture,
new FutureCallback<>() { new FutureCallback<>() {