Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 179d6e8e authored by Jason Monk's avatar Jason Monk
Browse files

Change PacProxySelector to return unresolved addr

This was found by a bug in Firefox where it expects the addresses from a
ProxySelector to be unresolved.  Since ProxySelectorImpl returns unresolved
addresses the PAC version should as well to avoid breaking apps.

The ProxyServer also needed to be updated to reflect this change as it was
expecting a resolved InetSocketAddress.

Bug: 11443853
Change-Id: I3a4e9e248d22d7808603c147660df708e01cdf82
parent 18612840
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ public class PacProxySelector extends ProxySelector {
                } catch (Exception e) {
                    port = 8080;
                }
                ret.add(new Proxy(Type.HTTP, new InetSocketAddress(host, port)));
                ret.add(new Proxy(Type.HTTP, InetSocketAddress.createUnresolved(host, port)));
            }
        }
        if (ret.size() == 0) {
+2 −2
Original line number Diff line number Diff line
@@ -117,8 +117,8 @@ public class ProxyServer extends Thread {
                        if (!proxy.equals(Proxy.NO_PROXY)) {
                            // Only Inets created by PacProxySelector.
                            InetSocketAddress inetSocketAddress =
                                    (InetSocketAddress)list.get(0).address();
                            server = new Socket(inetSocketAddress.getAddress(),
                                    (InetSocketAddress)proxy.address();
                            server = new Socket(inetSocketAddress.getHostName(),
                                    inetSocketAddress.getPort());
                            sendLine(server, requestLine);
                        } else {