Coming closer...

This commit is contained in:
vanitasvitae 2017-06-25 23:19:35 +02:00
parent daa6b6b999
commit 0952c20a5c
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 36 additions and 34 deletions

View File

@ -145,11 +145,15 @@ public class JingleS5BTransportSession extends JingleTransportSession<JingleS5BT
Socks5Client socks5Client = new Socks5Client(streamHost, receivedTransport.getDestinationAddress());
socket = socks5Client.getSocket(10 * 1000);
workedForUs = candidate;
LOGGER.log(Level.INFO, "Connected to remote address " + address + " with dstAddr "
+ receivedTransport.getDestinationAddress());
break;
} catch (IOException | XMPPException | InterruptedException | TimeoutException | SmackException e) {
LOGGER.log(Level.WARNING, "Could not connect to remotes address " + address + " with dstAddr "
+ receivedTransport.getDestinationAddress());
}
}
JingleContent content = jSession.getContents().get(0);
@ -178,7 +182,6 @@ public class JingleS5BTransportSession extends JingleTransportSession<JingleS5BT
closeIfBothSidesFailed();
}
}
private boolean closeIfBothSidesFailed() {
JingleSession jSession = jingleSession.get();
@ -234,7 +237,7 @@ public class JingleS5BTransportSession extends JingleTransportSession<JingleS5BT
return jutil.createErrorMalformedRequest(candidateUsed);
}
if (localUsedCandidate != null) {
if (localUsedCandidate != null || localError) {
try {
connect(determineUsedCandidate());
} catch (SmackException.NotConnectedException | InterruptedException e) {
@ -341,12 +344,11 @@ public class JingleS5BTransportSession extends JingleTransportSession<JingleS5BT
return IQ.createResultIQ(candidateError);
}
if (localUsedCandidate != null) {
if (localUsedCandidate.getType() != JingleS5BTransportCandidate.Type.proxy) {
//TODO: Connect
} else {
if (localUsedCandidate != null || localError) {
try {
connect(determineUsedCandidate());
} catch (SmackException.NotConnectedException | InterruptedException e) {
callback.onException(e);
}
}