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

RESOLVED FIXED in mozilla1.8.1beta2

Status

()

Core
Networking
RESOLVED FIXED
14 years ago
11 years ago

People

(Reporter: Dave, Assigned: Sylvain Pasche)

Tracking

({fixed1.8.1})

Trunk
mozilla1.8.1beta2
x86
All
fixed1.8.1
Points:
---
Bug Flags:
blocking1.8.1 +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

5.79 KB, application/x-javascript
Details
1.51 KB, patch
Biesinger
: review+
Darin Fisher
: superreview+
Mike Schroepfer
: approval1.8.1+
Details | Diff | Splinter Review
(Reporter)

Description

14 years ago
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.

Comment 1

14 years ago
->necko
Assignee: firefox → darin
Component: General → Networking
Product: Firefox → Browser
QA Contact: benc
Version: unspecified → Trunk

Comment 2

13 years ago
Reporter: Do you use a SOCKS proxy?

Comment 3

13 years ago
Does the same error occur in Firefox 1.0?

Comment 4

13 years ago
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.

Comment 5

13 years ago
*** Bug 276269 has been marked as a duplicate of this bug. ***

Comment 6

13 years ago
*** Bug 297051 has been marked as a duplicate of this bug. ***

Updated

12 years ago
Summary: incorrect error message for a non-existing url → incorrect error message for a non-existing url (socks4?)

Comment 7

12 years ago
*** Bug 315582 has been marked as a duplicate of this bug. ***

Updated

12 years ago
Assignee: darin → nobody
QA Contact: benc → networking
(Assignee)

Comment 8

12 years ago
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)
(Assignee)

Comment 9

12 years ago
Created attachment 227847 [details]
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
(Assignee)

Comment 10

12 years ago
Created attachment 227848 [details] [diff] [review]
patch, v1

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-
(Assignee)

Comment 12

12 years ago
Created attachment 227894 [details] [diff] [review]
patch, v2

Thanks for you quick review.

Here's a second try.
Attachment #227848 - Attachment is obsolete: true
Attachment #227894 - Flags: review?(cbiesinger)
(Assignee)

Comment 13

12 years ago
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)

Updated

12 years ago
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...
Attachment #227894 - Flags: approval1.8.1?
Flags: blocking1.8.1+
Target Milestone: --- → mozilla1.8.1beta2

Updated

11 years ago
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
Last Resolved: 11 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.