diff options
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.cpp | 6 |
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 | |||
@@ -127,32 +127,34 @@ void SOCKS5BytestreamProxiesManager::handleProxiesFound(std::vector<S5BProxyRequ | |||
127 | } | 127 | } |
128 | } | 128 | } |
129 | } | 129 | } |
130 | proxyFinder_->stop(); | 130 | proxyFinder_->stop(); |
131 | proxyFinder_.reset(); | 131 | proxyFinder_.reset(); |
132 | if (proxyHosts.empty()) { | ||
133 | onDiscoveredProxiesChanged(); | ||
134 | } | ||
132 | } | 135 | } |
133 | 136 | ||
134 | void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<HostAddress>& addresses, boost::optional<DomainNameResolveError> error, S5BProxyRequest::ref proxy) { | 137 | void SOCKS5BytestreamProxiesManager::handleNameLookupResult(const std::vector<HostAddress>& addresses, boost::optional<DomainNameResolveError> error, S5BProxyRequest::ref proxy) { |
135 | if (error) { | 138 | if (error) { |
136 | onDiscoveredProxiesChanged(); | 139 | onDiscoveredProxiesChanged(); |
137 | } | 140 | } |
138 | else { | 141 | else { |
139 | if (addresses.empty()) { | 142 | if (addresses.empty()) { |
140 | SWIFT_LOG(warning) << "S5B proxy hostname does not resolve." << std::endl; | 143 | SWIFT_LOG(warning) << "S5B proxy hostname does not resolve." << std::endl; |
141 | onDiscoveredProxiesChanged(); | ||
142 | } | 144 | } |
143 | else { | 145 | else { |
144 | // generate proxy per returned address | 146 | // generate proxy per returned address |
145 | foreach (const HostAddress& address, addresses) { | 147 | foreach (const HostAddress& address, addresses) { |
146 | S5BProxyRequest::StreamHost streamHost = proxy->getStreamHost().get(); | 148 | S5BProxyRequest::StreamHost streamHost = proxy->getStreamHost().get(); |
147 | S5BProxyRequest::ref proxyForAddress = boost::make_shared<S5BProxyRequest>(*proxy); | 149 | S5BProxyRequest::ref proxyForAddress = boost::make_shared<S5BProxyRequest>(*proxy); |
148 | streamHost.host = address.toString(); | 150 | streamHost.host = address.toString(); |
149 | proxyForAddress->setStreamHost(streamHost); | 151 | proxyForAddress->setStreamHost(streamHost); |
150 | addS5BProxy(proxyForAddress); | 152 | addS5BProxy(proxyForAddress); |
151 | } | 153 | } |
152 | onDiscoveredProxiesChanged(); | ||
153 | } | 154 | } |
155 | onDiscoveredProxiesChanged(); | ||
154 | } | 156 | } |
155 | } | 157 | } |
156 | 158 | ||
157 | void SOCKS5BytestreamProxiesManager::queryForProxies() { | 159 | void SOCKS5BytestreamProxiesManager::queryForProxies() { |
158 | proxyFinder_ = boost::make_shared<SOCKS5BytestreamProxyFinder>(serviceRoot_, iqRouter_); | 160 | proxyFinder_ = boost::make_shared<SOCKS5BytestreamProxyFinder>(serviceRoot_, iqRouter_); |