summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-11 17:13:41 (GMT)
committerSwift Review <review@swift.im>2015-02-11 09:36:14 (GMT)
commita049c80f0862a994a76e8e63d71c633bce63f66a (patch)
treec5fc7786d2d245c765067545bb9a0e433e58a3f9 /Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
parentf176050a50fb846bbad3fb49d6b2f7a2c81e3589 (diff)
downloadswift-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/IncomingJingleFileTransfer.cpp')
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
index daecf92..a0cd47c 100644
--- a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
@@ -80,7 +80,7 @@ void IncomingJingleFileTransfer::accept(
SWIFT_LOG(debug) << "Got S5B transport as initial payload." << std::endl;
setTransporter(transporterFactory->createResponderTransporter(
getInitiator(), getResponder(), s5bTransport->getSessionID(), options));
- transporter->addRemoteCandidates(s5bTransport->getCandidates());
+ transporter->addRemoteCandidates(s5bTransport->getCandidates(), s5bTransport->getDstAddr());
setState(GeneratingInitialLocalCandidates);
transporter->startGeneratingLocalCandidates();
}
@@ -109,7 +109,8 @@ void IncomingJingleFileTransfer::cancel() {
void IncomingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
const std::string& s5bSessionID,
- const std::vector<JingleS5BTransportPayload::Candidate>& candidates) {
+ const std::vector<JingleS5BTransportPayload::Candidate>& candidates,
+ const std::string& dstAddr) {
SWIFT_LOG(debug) << std::endl;
if (state != GeneratingInitialLocalCandidates) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; }
@@ -118,6 +119,7 @@ void IncomingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
transport->setSessionID(s5bSessionID);
transport->setMode(JingleS5BTransportPayload::TCPMode);
+ transport->setDstAddr(dstAddr);
foreach(JingleS5BTransportPayload::Candidate candidate, candidates) {
transport->addCandidate(candidate);
}
@@ -219,7 +221,8 @@ void IncomingJingleFileTransfer::handleTransportReplaceReceived(
return;
}
- if (JingleIBBTransportPayload::ref ibbTransport = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(transport)) {
+ JingleIBBTransportPayload::ref ibbTransport;
+ if (options.isInBandAllowed() && (ibbTransport = boost::dynamic_pointer_cast<JingleIBBTransportPayload>(transport))) {
SWIFT_LOG(debug) << "transport replaced with IBB" << std::endl;
startTransferring(transporter->createIBBReceiveSession(
@@ -338,12 +341,7 @@ bool IncomingJingleFileTransfer::hasPriorityOnCandidateTie() const {
}
void IncomingJingleFileTransfer::fallback() {
- if (options.isInBandAllowed()) {
- setState(WaitingForFallbackOrTerminate);
- }
- else {
- terminate(JinglePayload::Reason::ConnectivityError);
- }
+ setState(WaitingForFallbackOrTerminate);
}
void IncomingJingleFileTransfer::startTransferViaRemoteCandidate() {
@@ -369,7 +367,6 @@ void IncomingJingleFileTransfer::startTransferViaLocalCandidate() {
}
}
-
void IncomingJingleFileTransfer::startTransferring(boost::shared_ptr<TransportSession> transportSession) {
SWIFT_LOG(debug) << std::endl;
@@ -393,11 +390,11 @@ bool IncomingJingleFileTransfer::isTryingCandidates() const {
}
boost::shared_ptr<TransportSession> IncomingJingleFileTransfer::createLocalCandidateSession() {
- return transporter->createLocalCandidateSession(stream);
+ return transporter->createLocalCandidateSession(stream, theirCandidateChoice.get());
}
boost::shared_ptr<TransportSession> IncomingJingleFileTransfer::createRemoteCandidateSession() {
- return transporter->createRemoteCandidateSession(stream);
+ return transporter->createRemoteCandidateSession(stream, ourCandidateChoice.get());
}
void IncomingJingleFileTransfer::terminate(JinglePayload::Reason::Type reason) {