Changeset 6348 in josm
- Timestamp:
- 2013-10-31T21:14:35+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r6265 r6348 100 100 proxyPolicy = ProxyPolicy.NO_PROXY; 101 101 } else { 102 proxyPolicy = ProxyPolicy.fromName(value);102 proxyPolicy = ProxyPolicy.fromName(value); 103 103 if (proxyPolicy == null) { 104 104 Main.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value)); … … 108 108 String host = Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_HOST, null); 109 109 int port = parseProxyPortValue(ProxyPreferencesPanel.PROXY_HTTP_PORT, Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_PORT, null)); 110 if (host != null && !host.trim().isEmpty() && port > 0) {111 httpProxySocketAddress = new InetSocketAddress(host,port);112 } else{113 httpProxySocketAddress = null;114 if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)){110 httpProxySocketAddress = null; 111 if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)) { 112 if (host != null && !host.trim().isEmpty() && port > 0) { 113 httpProxySocketAddress = new InetSocketAddress(host, port); 114 } else { 115 115 Main.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port)); 116 116 Main.warn(tr("The proxy will not be used.")); … … 120 120 host = Main.pref.get(ProxyPreferencesPanel.PROXY_SOCKS_HOST, null); 121 121 port = parseProxyPortValue(ProxyPreferencesPanel.PROXY_SOCKS_PORT, Main.pref.get(ProxyPreferencesPanel.PROXY_SOCKS_PORT, null)); 122 if (host != null && !host.trim().isEmpty() && port > 0) {123 socksProxySocketAddress = new InetSocketAddress(host,port);124 } else{125 socksProxySocketAddress = null;126 if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)){122 socksProxySocketAddress = null; 123 if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)) { 124 if (host != null && !host.trim().isEmpty() && port > 0) { 125 socksProxySocketAddress = new InetSocketAddress(host,port); 126 } else { 127 127 Main.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port)); 128 128 Main.warn(tr("The proxy will not be used."));
Note:
See TracChangeset
for help on using the changeset viewer.