aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-27 14:41:01 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-27 14:41:01 +0100
commit592068e7cf06efa4803530e6ae55ea102dd7330c (patch)
treee7f7a4efafb67042c0888e93abcea96fcf173c17 /src/eu/siacs/conversations/utils
parent8988873d77bfab1a0788f3e1dbe051fceb879321 (diff)
code cleanup
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r--src/eu/siacs/conversations/utils/DNSHelper.java24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/eu/siacs/conversations/utils/DNSHelper.java b/src/eu/siacs/conversations/utils/DNSHelper.java
index 5ed9d9f5..dbdd2648 100644
--- a/src/eu/siacs/conversations/utils/DNSHelper.java
+++ b/src/eu/siacs/conversations/utils/DNSHelper.java
@@ -29,24 +29,17 @@ public class DNSHelper {
if (value != null && !"".equals(value)
&& !servers.contains(value)) {
ip = InetAddress.getByName(value);
- servers.add(value);
- Bundle result = queryDNS(host, ip);
- if (!result.containsKey("error")) {
- return result;
- }
+ servers.add(value);
+ Bundle result = queryDNS(host, ip);
+ if (!result.containsKey("error")) {
+ return result;
+ }
}
}
- } catch (ClassNotFoundException e) {
- ip = InetAddress.getByName("8.8.8.8");
- } catch (NoSuchMethodException e) {
- ip = InetAddress.getByName("8.8.8.8");
- } catch (IllegalAccessException e) {
- ip = InetAddress.getByName("8.8.8.8");
- } catch (IllegalArgumentException e) {
- ip = InetAddress.getByName("8.8.8.8");
- } catch (InvocationTargetException e) {
- ip = InetAddress.getByName("8.8.8.8");
+ } catch (Exception e) {
+ Log.d("xmppService","error during system calls");
}
+ ip = InetAddress.getByName("8.8.8.8");
return queryDNS(host, ip);
}
@@ -90,7 +83,6 @@ public class DNSHelper {
datagramSocket.setSoTimeout(3000);
datagramSocket.receive(receivePacket);
if (receiveData[3] != -128) {
- Log.d("xmppService", "not the right count");
namePort.putString("error", "nosrv");
return namePort;
}