summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
commitcfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch)
tree18d94153a302445196fc0c18586abf44a1ce4a38 /Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
parent1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff)
downloadswift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip
swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp')
-rw-r--r--Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
index 97e2706..296723e 100644
--- a/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
+++ b/Swiften/FileTransfer/RemoteJingleTransportCandidateSelector.cpp
@@ -25,73 +25,73 @@
using namespace Swift;
RemoteJingleTransportCandidateSelector::RemoteJingleTransportCandidateSelector(
- ConnectionFactory* connectionFactory,
- TimerFactory* timerFactory,
- const FileTransferOptions& options) :
- connectionFactory(connectionFactory),
- timerFactory(timerFactory),
- options(options) {
+ ConnectionFactory* connectionFactory,
+ TimerFactory* timerFactory,
+ const FileTransferOptions& options) :
+ connectionFactory(connectionFactory),
+ timerFactory(timerFactory),
+ options(options) {
}
RemoteJingleTransportCandidateSelector::~RemoteJingleTransportCandidateSelector() {
}
void RemoteJingleTransportCandidateSelector::addCandidates(
- const std::vector<JingleS5BTransportPayload::Candidate>& candidates) {
- foreach(JingleS5BTransportPayload::Candidate c, candidates) {
- this->candidates.push(c);
- }
+ const std::vector<JingleS5BTransportPayload::Candidate>& candidates) {
+ foreach(JingleS5BTransportPayload::Candidate c, candidates) {
+ this->candidates.push(c);
+ }
}
void RemoteJingleTransportCandidateSelector::startSelectingCandidate() {
- tryNextCandidate();
+ tryNextCandidate();
}
void RemoteJingleTransportCandidateSelector::stopSelectingCandidate() {
- if (s5bSession) {
- sessionReadyConnection.disconnect();
- s5bSession->stop();
- }
+ if (s5bSession) {
+ sessionReadyConnection.disconnect();
+ s5bSession->stop();
+ }
}
void RemoteJingleTransportCandidateSelector::tryNextCandidate() {
- if (candidates.empty()) {
- SWIFT_LOG(debug) << "No more candidates" << std::endl;
- onCandidateSelectFinished(
- boost::optional<JingleS5BTransportPayload::Candidate>(), boost::shared_ptr<SOCKS5BytestreamClientSession>());
- }
- else {
- lastCandidate = candidates.top();
- candidates.pop();
- SWIFT_LOG(debug) << "Trying candidate " << lastCandidate.cid << std::endl;
- if ((lastCandidate.type == JingleS5BTransportPayload::Candidate::DirectType && options.isDirectAllowed()) ||
- (lastCandidate.type == JingleS5BTransportPayload::Candidate::AssistedType && options.isAssistedAllowed()) ||
- (lastCandidate.type == JingleS5BTransportPayload::Candidate::ProxyType && options.isProxiedAllowed())) {
- boost::shared_ptr<Connection> connection = connectionFactory->createConnection();
- s5bSession = boost::make_shared<SOCKS5BytestreamClientSession>(
- connection, lastCandidate.hostPort, socks5DstAddr, timerFactory);
- sessionReadyConnection = s5bSession->onSessionReady.connect(
- boost::bind(&RemoteJingleTransportCandidateSelector::handleSessionReady, this, _1));
- s5bSession->start();
- }
- else {
- SWIFT_LOG(debug) << "Can't handle this type of candidate" << std::endl;
- tryNextCandidate();
- }
- }
+ if (candidates.empty()) {
+ SWIFT_LOG(debug) << "No more candidates" << std::endl;
+ onCandidateSelectFinished(
+ boost::optional<JingleS5BTransportPayload::Candidate>(), boost::shared_ptr<SOCKS5BytestreamClientSession>());
+ }
+ else {
+ lastCandidate = candidates.top();
+ candidates.pop();
+ SWIFT_LOG(debug) << "Trying candidate " << lastCandidate.cid << std::endl;
+ if ((lastCandidate.type == JingleS5BTransportPayload::Candidate::DirectType && options.isDirectAllowed()) ||
+ (lastCandidate.type == JingleS5BTransportPayload::Candidate::AssistedType && options.isAssistedAllowed()) ||
+ (lastCandidate.type == JingleS5BTransportPayload::Candidate::ProxyType && options.isProxiedAllowed())) {
+ boost::shared_ptr<Connection> connection = connectionFactory->createConnection();
+ s5bSession = boost::make_shared<SOCKS5BytestreamClientSession>(
+ connection, lastCandidate.hostPort, socks5DstAddr, timerFactory);
+ sessionReadyConnection = s5bSession->onSessionReady.connect(
+ boost::bind(&RemoteJingleTransportCandidateSelector::handleSessionReady, this, _1));
+ s5bSession->start();
+ }
+ else {
+ SWIFT_LOG(debug) << "Can't handle this type of candidate" << std::endl;
+ tryNextCandidate();
+ }
+ }
}
void RemoteJingleTransportCandidateSelector::handleSessionReady(bool error) {
- sessionReadyConnection.disconnect();
- if (error) {
- s5bSession.reset();
- tryNextCandidate();
- }
- else {
- onCandidateSelectFinished(lastCandidate, s5bSession);
- }
+ sessionReadyConnection.disconnect();
+ if (error) {
+ s5bSession.reset();
+ tryNextCandidate();
+ }
+ else {
+ onCandidateSelectFinished(lastCandidate, s5bSession);
+ }
}
void RemoteJingleTransportCandidateSelector::setSOCKS5DstAddr(const std::string& socks5DstAddr) {
- this->socks5DstAddr = socks5DstAddr;
+ this->socks5DstAddr = socks5DstAddr;
}