diff options
author | Tobias Markmann <tm@ayena.de> | 2015-01-11 17:13:41 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2015-02-11 09:36:14 (GMT) |
commit | a049c80f0862a994a76e8e63d71c633bce63f66a (patch) | |
tree | c5fc7786d2d245c765067545bb9a0e433e58a3f9 /Swiften/FileTransfer/JingleFileTransfer.cpp | |
parent | f176050a50fb846bbad3fb49d6b2f7a2c81e3589 (diff) | |
download | swift-a049c80f0862a994a76e8e63d71c633bce63f66a.zip swift-a049c80f0862a994a76e8e63d71c633bce63f66a.tar.bz2 |
Renable SOCKS5 bytestream proxy support for Jingle file transfers.
Test-Information:
Tested interoperability with Swiften using FileTransferTest.
Change-Id: Ic13a68a91cad199be0bfc8852ff43c25c7085f12
Diffstat (limited to 'Swiften/FileTransfer/JingleFileTransfer.cpp')
-rw-r--r-- | Swiften/FileTransfer/JingleFileTransfer.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Swiften/FileTransfer/JingleFileTransfer.cpp b/Swiften/FileTransfer/JingleFileTransfer.cpp index e2c0f3a..dbc4391 100644 --- a/Swiften/FileTransfer/JingleFileTransfer.cpp +++ b/Swiften/FileTransfer/JingleFileTransfer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -112,9 +112,11 @@ void JingleFileTransfer::decideOnCandidates() { fallback(); } else if (ourCandidateChoice && !theirCandidateChoice) { + SWIFT_LOG(debug) << "Start transfer using remote candidate: " << ourCandidateChoice.get().cid << "." << std::endl; startTransferViaRemoteCandidate(); } else if (theirCandidateChoice && !ourCandidateChoice) { + SWIFT_LOG(debug) << "Start transfer using local candidate: " << theirCandidateChoice.get().cid << "." << std::endl; startTransferViaLocalCandidate(); } else { @@ -122,16 +124,20 @@ void JingleFileTransfer::decideOnCandidates() { << ourCandidateChoice->cid << "(" << ourCandidateChoice->priority << ")" << " and " << theirCandidateChoice->cid << "(" << theirCandidateChoice->priority << ")" << std::endl; if (ourCandidateChoice->priority > theirCandidateChoice->priority) { + SWIFT_LOG(debug) << "Start transfer using remote candidate: " << ourCandidateChoice.get().cid << "." << std::endl; startTransferViaRemoteCandidate(); } else if (ourCandidateChoice->priority < theirCandidateChoice->priority) { + SWIFT_LOG(debug) << "Start transfer using local candidate:" << theirCandidateChoice.get().cid << "." << std::endl; startTransferViaLocalCandidate(); } else { if (hasPriorityOnCandidateTie()) { + SWIFT_LOG(debug) << "Start transfer using remote candidate: " << ourCandidateChoice.get().cid << std::endl; startTransferViaRemoteCandidate(); } else { + SWIFT_LOG(debug) << "Start transfer using local candidate: " << theirCandidateChoice.get().cid << std::endl; startTransferViaLocalCandidate(); } } @@ -156,7 +162,7 @@ void JingleFileTransfer::handleProxyActivateFinished( proxyActivate->setSessionID(s5bSessionID); proxyActivate->setActivated(theirCandidateChoice->cid); session->sendTransportInfo(getContentID(), proxyActivate); - startTransferring(createRemoteCandidateSession()); + startTransferring(createLocalCandidateSession()); } } @@ -193,6 +199,10 @@ void JingleFileTransfer::handleTransportInfoReceived( terminate(JinglePayload::Reason::GeneralError); } } + else if (s5bPayload->hasProxyError()) { + SWIFT_LOG(debug) << "Received proxy error. Trying to fall back to IBB." << std::endl; + fallback(); + } else { SWIFT_LOG(debug) << "Ignoring unknown info" << std::endl; } @@ -205,7 +215,7 @@ void JingleFileTransfer::handleTransportInfoReceived( void JingleFileTransfer::setTransporter(FileTransferTransporter* transporter) { this->transporter = transporter; localTransportCandidatesGeneratedConnection = transporter->onLocalCandidatesGenerated.connect( - boost::bind(&JingleFileTransfer::handleLocalTransportCandidatesGenerated, this, _1, _2)); + boost::bind(&JingleFileTransfer::handleLocalTransportCandidatesGenerated, this, _1, _2, _3)); remoteTransportCandidateSelectFinishedConnection = transporter->onRemoteCandidateSelectFinished.connect( boost::bind(&JingleFileTransfer::handleRemoteTransportCandidateSelectFinished, this, _1, _2)); proxyActivatedConnection = transporter->onProxyActivated.connect( |