Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ public synchronized void stop() {
}
this.serverThread = null;
this.serverSocket = null;

// Stop Sock5Proxy so a new localAddresses are retrieved on new authentication process.
socks5Server = null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.jxmpp.jid.Jid;

/**
* Manager for Jingle SOCKS5 Bytestream transports (XEP-0261).
* Manager for Jingle SOCKS5 Bytestream transports (XEP-0260).
*/
public final class JingleS5BTransportManager extends JingleTransportManager<JingleS5BTransport> {

Expand Down Expand Up @@ -133,7 +133,7 @@ public List<Bytestream.StreamHost> determineStreamHostInfo(List<Jid> proxies) {

@Override
public void authenticated(XMPPConnection connection, boolean resumed) {
if (!resumed) try {
try {
Socks5Proxy socks5Proxy = Socks5Proxy.getSocks5Proxy();
if (!socks5Proxy.isRunning()) {
socks5Proxy.start();
Expand All @@ -145,6 +145,19 @@ public void authenticated(XMPPConnection connection, boolean resumed) {
}
}

@Override
public void connectionClosed() {
Socks5Proxy proxy = Socks5Proxy.getSocks5Proxy();
if (proxy.isRunning()) {
Socks5Proxy.getSocks5Proxy().stop();
}
}

@Override
public void connectionClosedOnError(Exception e) {
connectionClosed();
}

public Jingle createCandidateUsed(FullJid recipient, FullJid initiator, String sessionId, JingleContent.Senders contentSenders,
JingleContent.Creator contentCreator, String contentName, String streamId,
String candidateId) {
Expand Down