summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-26 14:41:06 (GMT)
committerSwift Review <review@swift.im>2015-10-30 14:16:59 (GMT)
commit4a84a2570c5e8f2a282138c74448117ecd0a8939 (patch)
tree57c5a256c8d040157626828e0488395ec23c7557 /Swiften/FileTransfer
parent3d62970e1b929cf676202fc6cebc1cf426c14ff2 (diff)
downloadswift-4a84a2570c5e8f2a282138c74448117ecd0a8939.zip
swift-4a84a2570c5e8f2a282138c74448117ecd0a8939.tar.bz2
Fix bug in FT candidate discovery in absence of S5B proxies
With this commit SOCKS5BytestreamProxiesManager::onDiscoveredProxiesChanged will be emitted even if no proxies are found. Move signal emission out of if/else scopes as it was present in both cases. Test-Information: Tested file-transfer with the sender located at a server without a S5B proxy. Change-Id: Ic79928e539a6f39f23bfda370d701bf6d9ca9cbf
Diffstat (limited to 'Swiften/FileTransfer')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp
index 3221790..a1ef8f6 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp
@@ -129,6 +129,9 @@ void SOCKS5BytestreamProxiesManager::handleProxiesFound(std::vector<S5BProxyRequ
}
proxyFinder_->stop();
proxyFinder_.reset();
+ if (proxyHosts.empty()) {
+ onDiscoveredProxiesChanged();
+ }
}
void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<HostAddress>& addresses, boost::optional<DomainNameResolveError> error, S5BProxyRequest::ref proxy) {
@@ -138,7 +141,6 @@ void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<Ho
else {
if (addresses.empty()) {
SWIFT_LOG(warning) << "S5B proxy hostname does not resolve." << std::endl;
- onDiscoveredProxiesChanged();
}
else {
// generate proxy per returned address
@@ -149,8 +151,8 @@ void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<Ho
proxyForAddress->setStreamHost(streamHost);
addS5BProxy(proxyForAddress);
}
- onDiscoveredProxiesChanged();
}
+ onDiscoveredProxiesChanged();
}
}