Firefox 3 proxy auto config (PAC) reload button does not work

Bug #225520 reported by Hugues Fournier
2
Affects Status Importance Assigned to Milestone
XULRunner
Fix Released
Medium
xulrunner-1.9 (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Hardy by Hugues Fournier
Nominated for Intrepid by Hugues Fournier

Bug Description

Binary package hint: xulrunner-1.9

The reload button in the network panel of Firefox 3 beta 5 has no effect.
This can be checked either by tcpdumping the request of Firefox, when clicking on the button, or by hosting locally a PAC file and watching the logs.

I have tracked it down this regression to the checkin upstream that introduced the influence of http_proxy environment variable on our systems on the proxy configuration of Firefox / XULrunner.

A new (intended) behaviour of nsProtocolProxyService::ConfigureFromPAC was introduced in this checkin : ConfigureFromPAC exits early if the uri is already known (this check was previously in other methods).

However nsProtocolProxyService::ReloadPAC (that is called by the reload button) calls ConfigureFromPAC with obviously the same uri than the one already known (otherwise this would not be a reload ;) )

Here is the patch I have submitted upstream :

https://bugzilla.mozilla.org/attachment.cgi?id=318657

The corresponding upstream bug is bugzilla 422172.

Revision history for this message
In , Atisss (atisss) wrote :

Also doesn't work on
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b4) Gecko/2008030318 Firefox/3.0b4

The same configuration file worked on FF2. Restarting FF3b4 loads file correctly.

Config file:

function FindProxyForURL(url, host) {
    var internal_proxy = 'DIRECT';
    var no_proxy = 'DIRECT';
    var external_proxy = 'PROXY xx.xx.xx.xx:8888';

    var exclude_proxy = 'PROXY 127.0.0.1:80';

    if (shExpMatch(host, "*.draugiem.lv")) {
      return external_proxy;
    } else if (shExpMatch(url, "*draugiem.lv*")) {
      return external_proxy;
    } else if (shExpMatch(url, "*inbox.lv*")) {
      return external_proxy;

   /* repeats for lot of hosts */

   } else if (host=="neo") {
      return no_proxy;
    } else if (shExpMatch(url,"http*://*:*/*")) {
      return no_proxy;

    } else if (shExpMatch(url,"https://*")) {
      return internal_proxy;
    } else {
      return no_proxy;
    }
}

Revision history for this message
In , Marcia-mozilla (marcia-mozilla) wrote :

Confirming this based on this filing as well as reports in hendrix.

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Christopher, do you think you could find a 1-day regression range for the behavior changed you see between Firefox 2 and Firefox 3 beta 4, using -trunk builds from http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/ ? It would help a lot.

Revision history for this message
In , Hugues Fournier (hugues-fournier) wrote :

Gavin, I will try to locate the checkins that introduced this regression these coming days..

Revision history for this message
In , Hugues Fournier (hugues-fournier) wrote :

I have located the checkin that introduced this regression.

The regression appeared between build 2008-01-29-04-trunk and build 2008-01-29-04-trunk
The probable suspect seemed to be the checkin that resolved bug 66057 :
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/netwerk/base/src/nsProtocolProxyService.cpp&rev=1.74&root=/cvsroot
(that had been checked in, then backed out, then relanded on January 29)

And it was..

Since this checkin, ConfigureFromPAC exits if the uri is the same than the one already known, this is an intended behaviour:
"Switch to new PAC file if that setting has changed. If the setting hasn't changed, ConfigureFromPAC will exit early." (comment in the new code of Resolve_Internal introduced in this checkin)

The problem is that ConfigureFromPAC is called from ReloadPAC() too.

Revision history for this message
In , Hugues Fournier (hugues-fournier) wrote :

Created attachment 318315
Proposed patch

Here is a proposed patch allowing to short-circuit the "early exit" if the reload is forced.

Revision history for this message
In , Christian Biesinger (cbiesinger) wrote :

Comment on attachment 318315
Proposed patch

can you instead add an argument forceReload to ConfigureFromPAC?

Revision history for this message
In , Hugues Fournier (hugues-fournier) wrote :

Created attachment 318657
updated patch

I had avoided this way of doing because, for whatever stupid thoughtlessness ou tiredness, I had wrongly seen that ConfigureFromPAC was exposed to XPCOM (I had probably confounded it with ReloadPAC)..

Revision history for this message
Hugues Fournier (hugues-fournier) wrote : Firefox 3 proxy auto config (PAC) reload button do not work

Binary package hint: xulrunner-1.9

The reload button in the network panel of Firefox 3 beta 5 has no effect.
This can be checked either by tcpdumping the request of Firefox, when clicking on the button, or by hosting locally a PAC file and watching the logs.

I have tracked it down this regression to the checkin upstream that introduced the influence of http_proxy environment variable on our systems on the proxy configuration of Firefox / XULrunner.

A new (intended) behaviour of nsProtocolProxyService::ConfigureFromPAC was introduced in this checkin : ConfigureFromPAC exits early if the uri is already known (this check was previously in other methods).

However nsProtocolProxyService::ReloadPAC (that is called by the reload button) calls ConfigureFromPAC with obviously the same uri than the one already known (otherwise this would not be a reload ;) )

Here is the patch I have submitted upstream :

https://bugzilla.mozilla.org/attachment.cgi?id=318657

The corresponding upstream bug is bugzilla 422172.

Changed in xulrunner:
status: Unknown → Confirmed
Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

Here is a debdiff for Intrepid.

In addition to intrepid and hardy, gutsy-backports is affected. (I don't know if it would be correct to set gutsy as needing to be fixed ?)

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Comment on attachment 318657
updated patch

biesi can sr this as well (and presumably it is implied by his r+).

Revision history for this message
In , Christian Biesinger (cbiesinger) wrote :

Comment on attachment 318657
updated patch

We shouldn't ship broken UI. The patch is very safe.

Revision history for this message
In , Beltzner (beltzner) wrote :

Comment on attachment 318657
updated patch

a1.9=beltzner

Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

Patch had approval upstream to land in the 1.9 tree, and is waiting for checkin..

Revision history for this message
In , Reed Loden (reed) wrote :

Checking in netwerk/base/src/nsProtocolProxyService.cpp;
/cvsroot/mozilla/netwerk/base/src/nsProtocolProxyService.cpp,v <-- nsProtocolProxyService.cpp
new revision: 1.82; previous revision: 1.81
done
Checking in netwerk/base/src/nsProtocolProxyService.h;
/cvsroot/mozilla/netwerk/base/src/nsProtocolProxyService.h,v <-- nsProtocolProxyService.h
new revision: 1.34; previous revision: 1.33
done

Revision history for this message
In , Reed Loden (reed) wrote :

I backed this out to see if it was causing crashes, but it wasn't the patch. I'll reland this later today.

Revision history for this message
In , Reed Loden (reed) wrote :

Relanded.

Checking in netwerk/base/src/nsProtocolProxyService.cpp;
/cvsroot/mozilla/netwerk/base/src/nsProtocolProxyService.cpp,v <-- nsProtocolProxyService.cpp
new revision: 1.84; previous revision: 1.83
done
Checking in netwerk/base/src/nsProtocolProxyService.h;
/cvsroot/mozilla/netwerk/base/src/nsProtocolProxyService.h,v <-- nsProtocolProxyService.h
new revision: 1.36; previous revision: 1.35
done

Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

The patch has been checked in upstream.

Changed in xulrunner:
status: Confirmed → Fix Released
Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

Fixed with 1.9~rc1+nobinonly-0ubuntu1~8.04.2 in hardy and 1.9~rc1+nobinonly-0ubuntu1 in intrepid as my code has been checked in upstream in rc1.

Changed in xulrunner-1.9:
status: New → Fix Released
Revision history for this message
In , Benc-meer (benc-meer) wrote :

V/fixed.

I recently unit-tested the reload button's behavior to make sure it pulls from the http server. I used my test http server's access log to confirm.

Mac OS X 10.5, FF 3.0.1.

Changed in xulrunner:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.