From 8b4ceff1595b5a673f287d0ac442b9f3b65dda5e Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Thu, 6 Jul 2006 10:19:36 +0000 Subject: [PATCH] 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 r=biesi sr=darin git-svn-id: svn://10.0.0.236/trunk@201674 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/base/src/nsSocketTransport2.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mozilla/netwerk/base/src/nsSocketTransport2.cpp b/mozilla/netwerk/base/src/nsSocketTransport2.cpp index 5143ed3614b..9e6988fb175 100644 --- a/mozilla/netwerk/base/src/nsSocketTransport2.cpp +++ b/mozilla/netwerk/base/src/nsSocketTransport2.cpp @@ -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;