diff options
author | Alex Clayton <alex.clayton@isode.com> | 2016-01-26 16:33:29 (GMT) |
---|---|---|
committer | Alex Clayton <alex.clayton@isode.com> | 2016-01-27 12:29:01 (GMT) |
commit | 91e97e936fe671678758702bbede6a47b5487f13 (patch) | |
tree | f92b1939fb1704d602f30cbf3791bb98d1a56018 /src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java | |
parent | 97a085f7e2c9b7820000eaace97dc0ab6392cb0d (diff) | |
download | stroke-91e97e936fe671678758702bbede6a47b5487f13.zip stroke-91e97e936fe671678758702bbede6a47b5487f13.tar.bz2 |
Some fixes for File Transfer Patch
Some fixes that were required for the File Transfer Patch (see patch notes
on Gerrit).
Test-information:
By code inspection.
Ran against MLC (after modification so it works for stroke interface changes
introduces in a previous patch) it still runs correctly.
Ran unit tests they still all pass.
Change-Id: Ib49d9f9160f5e6b6b578f16695f8e8bc0f96a412
Diffstat (limited to 'src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java')
-rw-r--r-- | src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java b/src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java index 1cacda7..3839b26 100644 --- a/src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java +++ b/src/com/isode/stroke/filetransfer/LocalJingleTransportCandidateGenerator.java @@ -46,7 +46,12 @@ public class LocalJingleTransportCandidateGenerator { private SignalConnection onDiscoveredProxiesChangedConnection; private Logger logger_ = Logger.getLogger(this.getClass().getName()); - public LocalJingleTransportCandidateGenerator( + /** + * {@link SignalConnection} to {@link #s5bServerResourceUser_.onSuccessfulInitialized} + */ + private SignalConnection onSuccessfulInitializedConnection_; + + public LocalJingleTransportCandidateGenerator( SOCKS5BytestreamServerManager s5bServerManager, SOCKS5BytestreamProxiesManager s5bProxy, final JID ownJID, @@ -70,7 +75,7 @@ public class LocalJingleTransportCandidateGenerator { handleS5BServerInitialized(true); } else { - s5bServerResourceUser_.onSuccessfulInitialized.connect(new Slot1<Boolean>() { + onSuccessfulInitializedConnection_ = s5bServerResourceUser_.onSuccessfulInitialized.connect(new Slot1<Boolean>() { @Override public void call(Boolean b) { handleS5BServerInitialized(b); @@ -100,17 +105,17 @@ public class LocalJingleTransportCandidateGenerator { s5bServerPortForwardingUser_.onSetup.disconnectAll(); s5bServerPortForwardingUser_ = null; } - if (s5bServerResourceUser_ != null) { - s5bServerResourceUser_.onSuccessfulInitialized.disconnectAll(); - s5bServerResourceUser_ = null; + if (onSuccessfulInitializedConnection_ != null) { + onSuccessfulInitializedConnection_.disconnect(); } + s5bServerResourceUser_ = null; } public Signal1<Vector<JingleS5BTransportPayload.Candidate>> onLocalTransportCandidatesGenerated = new Signal1<Vector<JingleS5BTransportPayload.Candidate>>(); - + private void handleS5BServerInitialized(boolean success) { - if (s5bServerResourceUser_ != null) { - s5bServerResourceUser_.onSuccessfulInitialized.disconnectAll(); + if (onSuccessfulInitializedConnection_ != null) { + onSuccessfulInitializedConnection_.disconnect(); } triedServerInit_ = true; if (success) { @@ -130,9 +135,6 @@ public class LocalJingleTransportCandidateGenerator { } else { logger_.warning("Unable to start SOCKS5 server\n"); - if (s5bServerResourceUser_ != null) { - s5bServerResourceUser_.onSuccessfulInitialized.disconnectAll(); - } s5bServerResourceUser_ = null; handlePortForwardingSetup(false); } @@ -181,7 +183,7 @@ public class LocalJingleTransportCandidateGenerator { } if (options_.isAssistedAllowed()) { - // get assissted candidates + // get assisted candidates Vector<HostAddressPort> assisstedCandidates = s5bServerManager.getAssistedHostAddressPorts(); for(HostAddressPort addressPort : assisstedCandidates) { JingleS5BTransportPayload.Candidate candidate = new JingleS5BTransportPayload.Candidate(); |