Closed Bug 226943 Opened 21 years ago Closed 18 years ago

incorrect error message for a non-existing host (socks)

Categories

(Core :: Networking, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8.1beta2

People

(Reporter: dave, Assigned: sylvain.pasche)

References

()

Details

(Keywords: fixed1.8.1)

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Firebird/0.7

I use a proxy server. If I try and navigate to a non-existent URL (well,
sometimes it happens, you know!) the wrong error message is displayed.

It says 

"The proxy server you have configured could not be found. Please check your
proxy settings and try again."

but the proxy server is just fine and dandy - the message should say something like 

"That site either doesn't exist, is down, or there's some kind of DNS problem
with it. Please check your typing / the link you clicked and try again".



Reproducible: Always

Steps to Reproduce:
1. click a link to a dead site, OR
2. enter the URL of a dead site
3. press ENTER

Actual Results:  
Read above.

Expected Results:  
Read above.
->necko
Assignee: firefox → darin
Component: General → Networking
Product: Firefox → Browser
QA Contact: benc
Version: unspecified → Trunk
Reporter: Do you use a SOCKS proxy?
Does the same error occur in Firefox 1.0?
I am experiencing similiar behavior as the original bug.  However in my scenario
(Firefox 1.0, Win2k, manual proxy address entered.) I oftentimes have the
browser hang for long periods of time (30 seconds, a minute, indefinitely) when
it has trouble resolving an invalid address through the proxy.
*** Bug 276269 has been marked as a duplicate of this bug. ***
*** Bug 297051 has been marked as a duplicate of this bug. ***
Summary: incorrect error message for a non-existing url → incorrect error message for a non-existing url (socks4?)
*** Bug 315582 has been marked as a duplicate of this bug. ***
Assignee: darin → nobody
QA Contact: benc → networking
This also happens for socks5 on Linux (looks like to be platform independent).

OS -> all
summary -> incorrect error message for a non-existing url (socks proxy)
OS: Windows 2000 → All
Summary: incorrect error message for a non-existing url (socks4?) → incorrect error message for a non-existing url (socks)
Attached file Proxy errors testcase
The testcase I wrote for testing errors. On trunk, it give the following output:

+++ No proxy, resolvable URL
OnStopRequest status: NS_OK
+++ No proxy, unresolvable URL
OnStopRequest status: NS_ERROR_UNKNOWN_HOST
+++ SOCKS proxy using a non listening proxy port
OnStopRequest status: NS_ERROR_NET_RESET
+++ SOCKS proxy using a non resolvable proxy host
OnStopRequest status: NS_ERROR_FAILURE
+++ SOCKS proxy, resolvable URL
OnStopRequest status: NS_OK
+++ SOCKS proxy, unresolvable URL
OnStopRequest status: NS_ERROR_UNKNOWN_PROXY_HOST
+++ HTTP proxy using a non listening proxy port
OnStopRequest status: NS_ERROR_FAILURE
+++ HTTP proxy using a non resolvable proxy host
OnStopRequest status: NS_ERROR_UNKNOWN_PROXY_HOST
+++ HTTP proxy, resolvable URL
OnStopRequest status: NS_OK
+++ HTTP proxy, unresolvable URL
OnStopRequest status: NS_OK
Attached patch patch, v1 (obsolete) — Splinter Review
With this patch, the testcase returns:

+++ No proxy, resolvable URL
OnStopRequest status: NS_OK
+++ No proxy, unresolvable URL
OnStopRequest status: NS_ERROR_UNKNOWN_HOST
+++ SOCKS proxy using a non listening proxy port
OnStopRequest status: NS_ERROR_NET_RESET
+++ SOCKS proxy using a non resolvable proxy host
OnStopRequest status: NS_ERROR_FAILURE
+++ SOCKS proxy, resolvable URL
OnStopRequest status: NS_OK
+++ SOCKS proxy, unresolvable URL
OnStopRequest status: NS_ERROR_UNKNOWN_HOST
+++ HTTP proxy using a non listening proxy port
OnStopRequest status: NS_ERROR_FAILURE
+++ HTTP proxy using a non resolvable proxy host
OnStopRequest status: NS_ERROR_UNKNOWN_PROXY_HOST
+++ HTTP proxy, resolvable URL
OnStopRequest status: NS_OK
+++ HTTP proxy, unresolvable URL
OnStopRequest status: NS_OK


The difference is with "+++ SOCKS proxy, unresolvable URL", which returns now  NS_ERROR_UNKNOWN_HOST.

That solves the issue with the wrong error message, and makes the one-keywords searches work.
Attachment #227848 - Flags: review?(cbiesinger)
Comment on attachment 227848 [details] [diff] [review]
patch, v1

You should expand the comment a bit IMO. It took me a while to understand why this patch is correct. Mention that the socket transport actually resolves the real host here, not the proxy host, in case of SOCKS.

Also, please limit your lines to at most 80 characters.
Attachment #227848 - Flags: review?(cbiesinger) → review-
Attached patch patch, v2Splinter Review
Thanks for you quick review.

Here's a second try.
Attachment #227848 - Attachment is obsolete: true
Attachment #227894 - Flags: review?(cbiesinger)
s/you/your/
Comment on attachment 227894 [details] [diff] [review]
patch, v2

thanks
Attachment #227894 - Flags: superreview?(darin)
Attachment #227894 - Flags: review?(cbiesinger)
Attachment #227894 - Flags: review+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: incorrect error message for a non-existing url (socks) → incorrect error message for a non-existing host (socks)
Attachment #227894 - Flags: superreview?(darin) → superreview+
Assignee: nobody → sylvain.pasche
ok, I checked this into trunk
Checking in netwerk/base/src/nsSocketTransport2.cpp;
/cvsroot/mozilla/netwerk/base/src/nsSocketTransport2.cpp,v  <--  nsSocketTransport2.cpp
new revision: 1.44; previous revision: 1.43
done

Seems low-risk to me, IMO this should also be fixed on MOZILLA_1_8_BRANCH

It's unfortunate that there's not really a way to do an automated unit test for it, as that'd require a SOCKS server...
Flags: blocking1.8.1+
Target Milestone: --- → mozilla1.8.1beta2
Attachment #227894 - Flags: approval1.8.1? → approval1.8.1+
I guess we can resolve this bug, unless someone can think of a way to add a unit test for this bug.

fixed on MOZILLA_1_8_BRANCH:

Checking in nsSocketTransport2.cpp;
/cvsroot/mozilla/netwerk/base/src/nsSocketTransport2.cpp,v  <--  nsSocketTransport2.cpp
new revision: 1.36.4.2; previous revision: 1.36.4.1
done
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: