mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-05 16:43:26 +02:00
Removed app DNS cache
This commit is contained in:
@@ -425,8 +425,6 @@ public class EmailService implements AutoCloseable {
|
||||
String certificate, String fingerprint) throws MessagingException {
|
||||
properties.put("fairemail.server", host);
|
||||
|
||||
DnsHelper.clear(context);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean bind_socket = prefs.getBoolean("bind_socket", false);
|
||||
if (bind_socket &&
|
||||
@@ -639,20 +637,8 @@ public class EmailService implements AutoCloseable {
|
||||
// throw new MailConnectException(
|
||||
// new SocketConnectException("Debug", new IOException("Test"), host, port, 0));
|
||||
|
||||
String key = "dns." + host;
|
||||
try {
|
||||
main = DnsHelper.getByName(context, host, dnssec);
|
||||
EntityLog.log(context, EntityLog.Type.Network, "Main address=" + main);
|
||||
prefs.edit().putString(key, main.getHostAddress()).apply();
|
||||
} catch (UnknownHostException ex) {
|
||||
String last = prefs.getString(key, null);
|
||||
if (TextUtils.isEmpty(last))
|
||||
throw ex;
|
||||
else {
|
||||
EntityLog.log(context, EntityLog.Type.Network, "Using " + key + "=" + last);
|
||||
main = DnsHelper.getByName(context, last, dnssec);
|
||||
}
|
||||
}
|
||||
main = DnsHelper.getByName(context, host, dnssec);
|
||||
EntityLog.log(context, EntityLog.Type.Network, "Main address=" + main);
|
||||
|
||||
boolean prefer_ip4 = prefs.getBoolean("prefer_ip4", true);
|
||||
if (prefer_ip4 && main instanceof Inet6Address) {
|
||||
|
||||
Reference in New Issue
Block a user