1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-02 06:45:59 +01:00

Fix Socks5BytestreamManager.determineProxies()

We need to catch XMPPErrorException and *NoResponseException* and
blacklist those entities.
This commit is contained in:
Florian Schmaus 2014-03-23 14:57:18 +01:00
parent 010a86444a
commit 18d0dbdc5f

View file

@ -557,7 +557,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
List<String> proxies = new ArrayList<String>();
// get all items form XMPP server
// get all items from XMPP server
DiscoverItems discoverItems = serviceDiscoveryManager.discoverItems(this.connection.getServiceName());
Iterator<Item> itemIterator = discoverItems.getItems();
@ -570,9 +570,20 @@ public final class Socks5BytestreamManager implements BytestreamManager {
continue;
}
try {
DiscoverInfo proxyInfo;
try {
proxyInfo = serviceDiscoveryManager.discoverInfo(item.getEntityID());
}
catch (NoResponseException e) {
// blacklist errornous server
proxyBlacklist.add(item.getEntityID());
continue; }
catch (XMPPErrorException e) {
// blacklist errornous server
proxyBlacklist.add(item.getEntityID());
continue;
}
Iterator<Identity> identities = proxyInfo.getIdentities();
// item must have category "proxy" and type "bytestream"
@ -593,11 +604,6 @@ public final class Socks5BytestreamManager implements BytestreamManager {
}
}
catch (XMPPException e) {
// blacklist errornous server
this.proxyBlacklist.add(item.getEntityID());
}
}
return proxies;
}