mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
fixes bug 191715 "PAC: did not work, after a external site is shown" r=bbaetz sr=bz
This commit is contained in:
parent
40b182063f
commit
e601785fb3
@ -188,12 +188,13 @@ function dnsResolve(host) {
|
||||
if (host == dnsResolveCachedHost) {
|
||||
return dnsResolveCachedIp;
|
||||
}
|
||||
dnsResolveCachedHost = host;
|
||||
try {
|
||||
dnsResolveCachedIp = dns.resolve(host);
|
||||
dnsResolveCachedHost = host;
|
||||
}
|
||||
catch (e) {
|
||||
dnsResolveCachedIp = null;
|
||||
dnsResolveCachedHost = null;
|
||||
}
|
||||
return dnsResolveCachedIp;
|
||||
}
|
||||
|
@ -1720,6 +1720,13 @@ nsDNSService::Resolve(const char *i_hostname, char **o_ip)
|
||||
|
||||
if (index == 0) return NS_ERROR_FAILURE;
|
||||
else {
|
||||
// if netAddr is IPv4 mapped IPv6 address, then convert to IPv4 before
|
||||
// serializing (see bug 191715).
|
||||
if (PR_IsNetAddrType(&netAddr, PR_IpAddrV4Mapped)) {
|
||||
PRUint32 v4addr = netAddr.ipv6.ip.pr_s6_addr32[3];
|
||||
netAddr.inet.family = PR_AF_INET;
|
||||
netAddr.inet.ip = v4addr;
|
||||
}
|
||||
PRStatus status = PR_NetAddrToString(&netAddr, ipBuffer, sizeof(ipBuffer));
|
||||
if (status != PR_SUCCESS) return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user