bug 226943 Don't map NS_ERROR_UNKNOWN_HOST to NS_ERROR_UNKNOWN_PROXY_HOST when

a SOCKS proxy is used, because in that case, this code resolves the real host
rather than the proxy host

patch by Sylvain Pasche <sylvain.pasche@gmail.com> r=biesi sr=darin


git-svn-id: svn://10.0.0.236/trunk@201674 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de
2006-07-06 10:19:36 +00:00
parent 904d404373
commit 8b4ceff159

View File

@@ -1375,8 +1375,13 @@ nsSocketTransport::OnSocketEvent(PRUint32 type, nsresult status, nsISupports *pa
}
// status contains DNS lookup status
if (NS_FAILED(status)) {
// fixup error code if proxy was not found
if ((status == NS_ERROR_UNKNOWN_HOST) && !mProxyHost.IsEmpty())
// When using a HTTP proxy, NS_ERROR_UNKNOWN_HOST means the HTTP
// proxy host is not found, so we fixup the error code.
// For SOCKS proxies (mProxyTransparent == true), the socket
// transport resolves the real host here, so there's no fixup
// (see bug 226943).
if ((status == NS_ERROR_UNKNOWN_HOST) && !mProxyTransparent &&
!mProxyHost.IsEmpty())
mCondition = NS_ERROR_UNKNOWN_PROXY_HOST;
else
mCondition = status;