happy eyeball: fix connection without dns
This commit is contained in:
parent
e3b5be777c
commit
b465011045
|
@ -80,7 +80,12 @@ public class Resolver {
|
|||
public static Result fromHardCoded(String hostname, int port) {
|
||||
final Result ipResult = fromIpAddress(hostname, port);
|
||||
if (ipResult != null) {
|
||||
try {
|
||||
ipResult.connect();
|
||||
} catch (Exception e) {
|
||||
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": from hardcoded unable to connect: "+ e);
|
||||
return null;
|
||||
}
|
||||
return ipResult;
|
||||
}
|
||||
return happyEyeball(resolveNoSrvRecords(DNSName.from(hostname), port, true));
|
||||
|
@ -94,7 +99,12 @@ public class Resolver {
|
|||
public static Result resolve(String domain) {
|
||||
final Result ipResult = fromIpAddress(domain, DEFAULT_PORT_XMPP);
|
||||
if (ipResult != null) {
|
||||
try {
|
||||
ipResult.connect();
|
||||
} catch (Exception e) {
|
||||
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": from hardcoded unable to connect: "+ e);
|
||||
return null;
|
||||
}
|
||||
return ipResult;
|
||||
}
|
||||
final List<Result> results = new ArrayList<>();
|
||||
|
@ -304,7 +314,12 @@ public class Resolver {
|
|||
if (r.size() == 1) {
|
||||
result = r.get(0);
|
||||
result.setLogID(logID);
|
||||
try {
|
||||
result.connect();
|
||||
} catch (Exception e) {
|
||||
Log.i(Config.LOGTAG, Resolver.class.getSimpleName() + ": from hardcoded unable to connect: "+ e);
|
||||
return null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -361,7 +376,7 @@ public class Resolver {
|
|||
private int priority;
|
||||
private Socket socket;
|
||||
|
||||
private String logID;
|
||||
private String logID = "";
|
||||
|
||||
static Result fromRecord(SRV srv, boolean directTls) {
|
||||
Result result = new Result();
|
||||
|
|
Loading…
Reference in New Issue