summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-11 12:39:50 (GMT)
committerSwift Review <review@swift.im>2015-02-11 09:35:33 (GMT)
commit9281a35fb912657f98ff0918ed683b2ef6071b45 (patch)
tree9a9ac8a5e9cf9f2d3680fbc2323e643f03bfe5d8 /Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
parent779f0d57bc9d90300aad0b1386dc937612ac35f4 (diff)
downloadswift-9281a35fb912657f98ff0918ed683b2ef6071b45.zip
swift-9281a35fb912657f98ff0918ed683b2ef6071b45.tar.bz2
Restrict generated candidates and selected candidates to those allowed
by supplied FileTransferOptions. Test-Information: Automatically tested all FileTransferOption combinations and verified it generates only allowed candidates. Change-Id: I0b3ce983a3f230a4c2c3940f5d928fd74d6012b6
Diffstat (limited to 'Swiften/FileTransfer/DefaultFileTransferTransporter.cpp')
-rw-r--r--Swiften/FileTransfer/DefaultFileTransferTransporter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp b/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
index 1a77685..2c54d88 100644
--- a/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
+++ b/Swiften/FileTransfer/DefaultFileTransferTransporter.cpp
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2013-2014 Isode Limited.
+ * Copyright (c) 2013-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/FileTransfer/DefaultFileTransferTransporter.h>
@@ -135,32 +135,35 @@ DefaultFileTransferTransporter::DefaultFileTransferTransporter(
SOCKS5BytestreamServerManager* s5bServerManager,
SOCKS5BytestreamProxiesManager* s5bProxy,
IDGenerator* idGenerator,
ConnectionFactory* connectionFactory,
TimerFactory* timerFactory,
CryptoProvider* crypto,
- IQRouter* router) :
+ IQRouter* router,
+ const FileTransferOptions& options) :
initiator(initiator),
responder(responder),
role(role),
s5bRegistry(s5bRegistry),
s5bServerManager(s5bServerManager),
crypto(crypto),
router(router) {
localCandidateGenerator = new LocalJingleTransportCandidateGenerator(
s5bServerManager,
s5bProxy,
role == Initiator ? initiator : responder,
- idGenerator);
+ idGenerator,
+ options);
localCandidateGenerator->onLocalTransportCandidatesGenerated.connect(
boost::bind(&DefaultFileTransferTransporter::handleLocalCandidatesGenerated, this, _1));
remoteCandidateSelector = new RemoteJingleTransportCandidateSelector(
connectionFactory,
- timerFactory);
+ timerFactory,
+ options);
remoteCandidateSelector->onCandidateSelectFinished.connect(
boost::bind(&DefaultFileTransferTransporter::handleRemoteCandidateSelectFinished, this, _1, _2));
}
DefaultFileTransferTransporter::~DefaultFileTransferTransporter() {
delete remoteCandidateSelector;