Skip to content

Improvement in proxy fallback selection #54

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

1.Configure a PAC file having one or more unreachable proxies.
2.Wrap ProxyListFallbackSelector around PacProxySelector.
3.Try to browse some URL for which no proxy is responsive.

What is the expected output? What do you see instead?

Actual behavior: The selection completely relies on filtering of unresponsive 
proxies even if we don't have anything to fallback on, i.e. empty list.
Expected behavior: Better to retry unresponsive proxy when there is nothing to 
fallback on.

What version of the product are you using? On what operating system?

Library version: 2013-12-09
OS version: Windows 7

Please provide any additional information below.

Proposed fix code snippet:

@Override
public List<Proxy> select(URI uri) {
    cleanupCache();
    List<Proxy> proxyList = this.delegate.select(uri);
    List<Proxy> result = filterUnresponsiveProxiesFromList(proxyList);
    if (result.isEmpty()) {
        return proxyList;
    }
    return result;
}

Original issue reported on code.google.com by dharmara...@gmail.com on 17 Nov 2014 at 10:45

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions