зеркало из https://github.com/mozilla/pjs.git
Bug 235853: don't freeze the UI when resolving DNS for PAC, by using deferred resolution if we would otherwise block on DNS. r+madskills=biesi, a-b5=mconnor
This commit is contained in:
Родитель
c50992c60a
Коммит
5e0248590c
|
@ -550,7 +550,17 @@ nsIOService::NewChannelFromURI(nsIURI *aURI, nsIChannel **result)
|
|||
NS_WARNING("failed to get protocol proxy service");
|
||||
}
|
||||
if (mProxyService) {
|
||||
rv = mProxyService->Resolve(aURI, 0, getter_AddRefs(pi));
|
||||
PRUint32 flags = 0;
|
||||
if (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https"))
|
||||
flags = nsIProtocolProxyService::RESOLVE_NON_BLOCKING;
|
||||
rv = mProxyService->Resolve(aURI, flags, getter_AddRefs(pi));
|
||||
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
|
||||
// Use an UNKNOWN proxy to defer resolution and avoid blocking.
|
||||
rv = mProxyService->NewProxyInfo(NS_LITERAL_CSTRING("unknown"),
|
||||
NS_LITERAL_CSTRING(""),
|
||||
-1, 0, 0, nsnull,
|
||||
getter_AddRefs(pi));
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
pi = nsnull;
|
||||
}
|
||||
|
|
|
@ -923,7 +923,8 @@ nsProtocolProxyService::NewProxyInfo(const nsACString &aType,
|
|||
kProxyType_HTTP,
|
||||
kProxyType_SOCKS,
|
||||
kProxyType_SOCKS4,
|
||||
kProxyType_DIRECT
|
||||
kProxyType_DIRECT,
|
||||
kProxyType_UNKNOWN
|
||||
};
|
||||
|
||||
// resolve type; this allows us to avoid copying the type string into each
|
||||
|
|
Загрузка…
Ссылка в новой задаче