Bug 1678614 - Don't try to resolve the host name again when trr mode is trr only r=necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D98024
This commit is contained in:
Kershaw Chang 2020-11-30 21:04:10 +00:00
Родитель bb00136d43
Коммит 86442ca53f
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -1944,13 +1944,19 @@ bool nsSocketTransport::RecoverFromError() {
mNetAddr.inet6.ip.u64[1] == 0))) {
SOCKET_LOG((" TRR returned 0.0.0.0 and there are no other IPs"));
} else if (trrEnabled) {
// Drop state to closed. This will trigger a new round of
// DNS resolving. Bypass the cache this time since the
// cached data came from TRR and failed already!
SOCKET_LOG((" failed to connect with TRR enabled, try w/o\n"));
mState = STATE_CLOSED;
mConnectionFlags |= DISABLE_TRR | BYPASS_CACHE | REFRESH_CACHE;
tryAgain = true;
nsCOMPtr<nsIDNSService> dns = do_GetService(kDNSServiceCID);
uint32_t trrMode = 0;
// If current trr mode is trr only, we should not retry.
if (dns && NS_SUCCEEDED(dns->GetCurrentTrrMode(&trrMode)) &&
trrMode != 3) {
// Drop state to closed. This will trigger a new round of
// DNS resolving. Bypass the cache this time since the
// cached data came from TRR and failed already!
SOCKET_LOG((" failed to connect with TRR enabled, try w/o\n"));
mState = STATE_CLOSED;
mConnectionFlags |= DISABLE_TRR | BYPASS_CACHE | REFRESH_CACHE;
tryAgain = true;
}
}
}
}