summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp')
-rw-r--r--Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp
index 09b664f..834a401 100644
--- a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp
+++ b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp
@@ -141,51 +141,51 @@ void LocalJingleTransportCandidateGenerator::emitOnLocalTransportCandidatesGener
std::vector<HostAddressPort> directCandidates = s5bServerManager->getHostAddressPorts();
for(auto&& addressPort : directCandidates) {
if (addressPort.getAddress().getRawAddress().is_v6() &&
addressPort.getAddress().getRawAddress().to_v6().is_link_local()) {
continue;
}
JingleS5BTransportPayload::Candidate candidate;
candidate.type = JingleS5BTransportPayload::Candidate::DirectType;
candidate.jid = ownJID;
candidate.hostPort = addressPort;
candidate.priority = 65536 * 126 + LOCAL_PREFERENCE;
candidate.cid = idGenerator->generateID();
candidates.push_back(candidate);
}
}
if (options_.isAssistedAllowed()) {
// get assissted candidates
std::vector<HostAddressPort> assisstedCandidates = s5bServerManager->getAssistedHostAddressPorts();
for (auto&& addressPort : assisstedCandidates) {
JingleS5BTransportPayload::Candidate candidate;
candidate.type = JingleS5BTransportPayload::Candidate::AssistedType;
candidate.jid = ownJID;
candidate.hostPort = addressPort;
candidate.priority = 65536 * 120 + LOCAL_PREFERENCE;
candidate.cid = idGenerator->generateID();
candidates.push_back(candidate);
}
}
- if (options_.isProxiedAllowed() && s5bProxy->getOrDiscoverS5BProxies().is_initialized()) {
+ if (options_.isProxiedAllowed() && s5bProxy && s5bProxy->getOrDiscoverS5BProxies().is_initialized()) {
for (auto&& proxy : s5bProxy->getOrDiscoverS5BProxies().get()) {
if (proxy->getStreamHost()) { // FIXME: Added this test, because there were cases where this wasn't initialized. Investigate this. (Remko)
JingleS5BTransportPayload::Candidate candidate;
candidate.type = JingleS5BTransportPayload::Candidate::ProxyType;
candidate.jid = (*proxy->getStreamHost()).jid;
auto address = HostAddress::fromString((*proxy->getStreamHost()).host);
if (address) {
candidate.hostPort = HostAddressPort(address.get(), (*proxy->getStreamHost()).port);
candidate.priority = 65536 * 10 + LOCAL_PREFERENCE;
candidate.cid = idGenerator->generateID();
candidates.push_back(candidate);
}
}
}
}
onLocalTransportCandidatesGenerated(candidates);
}
}