Closed Bug 353392 Opened 19 years ago Closed 16 years ago

ChatZilla tries to connect before proxy settings are loaded.

Categories

(Other Applications Graveyard :: ChatZilla, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bloopy, Assigned: bugzilla-mozilla-20000923)

Details

(Keywords: regression, Whiteboard: [cz-0.9.85])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Build Identifier: ChatZilla 0.9.75, Firefox 1.5.0.7 When Firefox is not running, launching ChatZilla using a shortcut to "C:\Program Files\Mozilla Firefox\firefox.exe" -chat allows ChatZilla to attempt a connection before Firefox proxy settings are loaded (I am using a proxy.pac file in my My Documents folder). Reproducible: Always Steps to Reproduce: 1. Set Firefox to use a proxy.pac file which specifies a proxy to connect to. 2. Exit Firefox 3. Launch ChatZilla using a shortcut to "C:\Program Files\Mozilla Firefox\firefox.exe" -chat Actual Results: ChatZilla attempts its first connection without using the proxy, and if the IRC server is inaccessible without the proxy, then the connection is refused. The second connection succeeds. Expected Results: If possible, ChatZilla should wait if the proxy settings have not yet been loaded.
Note: this is with ChatZilla set to automatically connect on startup.
I thought Necko blocked connections that might need the proxy until it had loaded the PAC file.
I've just done a test, and found that the first connection attempt can succeed without using any proxy at all, if the PAC file has not yet loaded.
I can reproduce this in Firefox 1.5 and 2.0, but not in 1.0, so it looks to be an ancient core regression. :(
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
From what I can see, the PAC Manager returns NS_ERROR_IN_PROGRESS for sync requests to get the proxy info, but will let async ones wait for the PAC file to load. The nsIProtocolProxyService.resolve call catches this and returns a special "unknown" proxy info object (i.e. proxyInfo.type == "unknown"). The object is only scriptable from 2005-03-24 onwards. The unknown type was added on 2005-06-24 (bug 100022). Basically, it's: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/netwerk/base/public/nsIProtocolProxyService.idl&rev=1.15&mark=98-102#98 The problem is that our connect call must complete syncronously, which is somewhat hard when using nsIProtocolProxyService.asyncResolve.
(In reply to comment #5) http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/netwerk/base/public/nsIProtocolProxyService.idl&rev=1.15&mark=98-102#98 > > The problem is that our connect call must complete syncronously, which is > somewhat hard when using nsIProtocolProxyService.asyncResolve. We could just show an error/warning and use our progressive backoff reconnect stuff to wait until we do have proxy info? Or am I missing something here?
Ideally, we would show a [WARNING] (instead of [ERROR]), wait 15s and try the *same* server again.
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → Trunk
There's surprisingly little to this patch, ignoring the style tweaks I did. It roughly goes like this: if the proxy is "unknown", it's still loading. So we throw a known exception, which gets caught in CIRCNetwork.prototype.onDoConnect and turned into an onError event. I decided it was better to reconnect in the core, so onDoConnect also initiates the reconnect (using a shorter time and the same host). CIRCNetwork.prototype.onError simply displays the warning message and avoids deleteWhenDone (just in case - we shouldn't end up here with it set, I don't think).
Assignee: rginda → silver
Status: NEW → ASSIGNED
Attachment #357583 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 357583 [details] [diff] [review] Display message when PAC is still loading and retry OK, this looks good! r=me :-)
Attachment #357583 - Flags: review?(gijskruitbosch+bugs) → review+
Checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.85]
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: