8214014: Remove vestiges of gopher: protocol proxy support

Reviewed-by: lancea, alanb
This commit is contained in:
Roger Riggs 2018-11-28 16:04:36 -05:00
parent c1034b1cad
commit 48d68d182a
12 changed files with 10 additions and 64 deletions

View File

@ -417,13 +417,11 @@ void setProxyProperties(java_props_t *sProps) {
cf_httpsHost = NULL,
cf_ftpHost = NULL,
cf_socksHost = NULL,
cf_gopherHost = NULL;
int
httpPort = 80, // Default proxy port values
httpsPort = 443,
ftpPort = 21,
socksPort = 1080,
gopherPort = 70;
CFDictionaryRef dict = SCDynamicStoreCopyProxies(NULL);
if (dict == NULL) return;
@ -479,7 +477,6 @@ void setProxyProperties(java_props_t *sProps) {
CHECK_PROXY(https, HTTPS);
CHECK_PROXY(ftp, FTP);
CHECK_PROXY(socks, SOCKS);
CHECK_PROXY(gopher, Gopher);
#undef CHECK_PROXY

View File

@ -85,9 +85,6 @@ public final class SystemProps {
putIfAbsent(props, "ftp.proxyPort", raw.propDefault(Raw._ftp_proxyPort_NDX));
putIfAbsent(props, "socksProxyHost", raw.propDefault(Raw._socksProxyHost_NDX));
putIfAbsent(props, "socksProxyPort", raw.propDefault(Raw._socksProxyPort_NDX));
putIfAbsent(props, "gopherProxySet", raw.propDefault(Raw._gopherProxySet_NDX));
putIfAbsent(props, "gopherProxyHost", raw.propDefault(Raw._gopherProxyHost_NDX));
putIfAbsent(props, "gopherProxyPort", raw.propDefault(Raw._gopherProxyPort_NDX));
putIfAbsent(props, "http.nonProxyHosts", raw.propDefault(Raw._http_nonProxyHosts_NDX));
putIfAbsent(props, "ftp.nonProxyHosts", raw.propDefault(Raw._ftp_nonProxyHosts_NDX));
putIfAbsent(props, "socksNonProxyHosts", raw.propDefault(Raw._socksNonProxyHosts_NDX));
@ -201,10 +198,7 @@ public final class SystemProps {
@Native private static final int _ftp_nonProxyHosts_NDX = 1 + _format_variant_NDX;
@Native private static final int _ftp_proxyHost_NDX = 1 + _ftp_nonProxyHosts_NDX;
@Native private static final int _ftp_proxyPort_NDX = 1 + _ftp_proxyHost_NDX;
@Native private static final int _gopherProxyHost_NDX = 1 + _ftp_proxyPort_NDX;
@Native private static final int _gopherProxyPort_NDX = 1 + _gopherProxyHost_NDX;
@Native private static final int _gopherProxySet_NDX = 1 + _gopherProxyPort_NDX;
@Native private static final int _http_nonProxyHosts_NDX = 1 + _gopherProxySet_NDX;
@Native private static final int _http_nonProxyHosts_NDX = 1 + _ftp_proxyPort_NDX;
@Native private static final int _http_proxyHost_NDX = 1 + _http_nonProxyHosts_NDX;
@Native private static final int _http_proxyPort_NDX = 1 + _http_proxyHost_NDX;
@Native private static final int _https_proxyHost_NDX = 1 + _http_proxyPort_NDX;

View File

@ -53,7 +53,6 @@ import static java.util.stream.Collectors.toList;
*
* Supports http/https/ftp.proxyHost, http/https/ftp.proxyPort,
* proxyHost, proxyPort, and http/https/ftp.nonProxyHost, and socks.
* NOTE: need to do gopher as well
*/
public class DefaultProxySelector extends ProxySelector {
@ -82,7 +81,6 @@ public class DefaultProxySelector extends ProxySelector {
{"http", "http.proxy", "proxy", "socksProxy"},
{"https", "https.proxy", "proxy", "socksProxy"},
{"ftp", "ftp.proxy", "ftpProxy", "proxy", "socksProxy"},
{"gopher", "gopherProxy", "socksProxy"},
{"socket", "socksProxy"}
};
@ -350,8 +348,6 @@ public class DefaultProxySelector extends ProxySelector {
return 80;
} else if ("socket".equalsIgnoreCase(protocol)) {
return 1080;
} else if ("gopher".equalsIgnoreCase(protocol)) {
return 80;
} else {
return -1;
}

View File

@ -14,7 +14,7 @@
# Note that the system properties that do explicitly set proxies
# (like http.proxyHost) do take precedence over the system settings
# even if java.net.useSystemProxies is set to true.
java.net.useSystemProxies=false
#------------------------------------------------------------------------
@ -51,13 +51,6 @@ http.nonProxyHosts=localhost|127.*|[::1]
# ftp.proxyPort=80
ftp.nonProxyHosts=localhost|127.*|[::1]
#
# Gopher Proxy settings. proxyHost is the name of the proxy server
# (e.g. proxy.mydomain.com), proxyPort is the port number to use (default
# value is 80)
#
# gopher.proxyHost=
# gopher.proxyPort=80
#
# Socks proxy settings. socksProxyHost is the name of the proxy server
# (e.g. socks.domain.com), socksProxyPort is the port number to use
# (default value is 1080)
@ -66,8 +59,8 @@ ftp.nonProxyHosts=localhost|127.*|[::1]
# socksProxyPort=1080
#
# HTTP Keep Alive settings. remainingData is the maximum amount of data
# in kilobytes that will be cleaned off the underlying socket so that it
# can be reused (default value is 512K), queuedConnections is the maximum
# in kilobytes that will be cleaned off the underlying socket so that it
# can be reused (default value is 512K), queuedConnections is the maximum
# number of Keep Alive connections to be on the queue for clean up (default
# value is 10).
# http.KeepAlive.remainingData=512
@ -105,10 +98,10 @@ jdk.http.auth.tunneling.disabledSchemes=Basic
# By default, the following request headers are not allowed to be set by user code
# in HttpRequests: "connection", "content-length", "expect", "host" and "upgrade".
# The 'jdk.httpclient.allowRestrictedHeaders' property allows one or more of these
# headers to be specified as a comma separated list to override the default restriction.
# The names are case-insensitive and white-space is ignored (removed before processing
# the list). Note, this capability is mostly intended for testing and isn't expected
# to be used in real deployments. Protocol errors or other undefined behavior is likely
# headers to be specified as a comma separated list to override the default restriction.
# The names are case-insensitive and white-space is ignored (removed before processing
# the list). Note, this capability is mostly intended for testing and isn't expected
# to be used in real deployments. Protocol errors or other undefined behavior is likely
# to occur when using them. The property is not set by default.
# Note also, that there may be other headers that are restricted from being set
# depending on the context. This includes the "Authorization" header when the

View File

@ -184,15 +184,6 @@ Java_jdk_internal_util_SystemProps_00024Raw_platformProperties(JNIEnv *env, jcla
PUTPROP(propArray, _socksProxyPort_NDX, sprops->socksPort);
}
if (sprops->gopherProxyEnabled) {
// The gopher client is different in that it expects an 'is this set?' flag that the others don't.
PUTPROP(propArray, _gopherProxySet_NDX, "true");
PUTPROP(propArray, _gopherProxyHost_NDX, sprops->gopherHost);
PUTPROP(propArray, _gopherProxyPort_NDX, sprops->gopherPort);
} else {
PUTPROP(propArray, _gopherProxySet_NDX, "false");
}
// Mac OS X only has a single proxy exception list which applies
// to all protocols
if (sprops->exceptionList) {

View File

@ -106,10 +106,6 @@ typedef struct {
char *socksHost;
char *socksPort;
int gopherProxyEnabled;
char *gopherHost;
char *gopherPort;
char *exceptionList;
char *awt_headless; /* java.awt.headless setting, if NULL (default) will not be set */

View File

@ -59,8 +59,6 @@
* - /system/proxy/ftp_port int
* - /system/proxy/secure_port int
* - /system/proxy/no_proxy_for list
* - /system/proxy/gopher_host string
* - /system/proxy/gopher_port int
*
* The following keys are not used in the new gnome 3
* - /system/http_proxy/use_http_proxy
@ -223,18 +221,6 @@ static jobjectArray getProxyByGConf(JNIEnv *env, const char* cproto,
use_proxy = (phost != NULL && pport != 0);
}
/**
* GOPHER:
* /system/proxy/mode (string) [ "manual" means use proxy settings ]
* /system/proxy/gopher_host (string)
* /system/proxy/gopher_port (integer)
*/
if (strcasecmp(cproto, "gopher") == 0) {
phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL);
pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL);
use_proxy = (phost != NULL && pport != 0);
}
/**
* SOCKS:
* /system/proxy/mode (string) [ "manual" means use proxy settings ]

View File

@ -296,8 +296,7 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
/* Set the default port value & proxy type from protocol. */
if ((wcscmp(lpProto, L"http") == 0) ||
(wcscmp(lpProto, L"ftp") == 0) ||
(wcscmp(lpProto, L"gopher") == 0))
(wcscmp(lpProto, L"ftp") == 0))
defport = 80;
if (wcscmp(lpProto, L"https") == 0)
defport = 443;

View File

@ -271,7 +271,7 @@ public class JAXPTestUtilities {
protected static boolean isCommonURL(String s) {
if (null == s)
return false;
return Pattern.compile("^(file:|http:|ftp:|gopher:|mailto:|news:|telnet:)")
return Pattern.compile("^(file:|http:|ftp:|mailto:|news:|telnet:)")
.matcher(s).matches();
}

View File

@ -53,7 +53,6 @@ public class SystemProxies {
printProxies("https://");
printProxies("ftp://");
printProxies("none://");
printProxies("gopher://");
printProxies("rtsp://");
printProxies("socket://");
}

View File

@ -682,10 +682,6 @@ public class Test {
test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
.s("ftp").h("ftp.is.co.za").p("/rfc/rfc1808.txt").z();
test("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles")
.s("gopher").h("spinaltap.micro.umn.edu")
.p("/00/Weather/California/Los%20Angeles").z();
test("http://www.math.uio.no/faq/compression-faq/part1.html")
.s("http").h("www.math.uio.no").p("/faq/compression-faq/part1.html").z();

View File

@ -107,7 +107,6 @@ public class RequestBuilderTest {
URI.create("ws://foo.com"),
URI.create("wss://foo.com"),
URI.create("ftp://foo.com"),
URI.create("gopher://foo.com"),
URI.create("mailto:a@b.com"),
URI.create("scheme:example.com"),
URI.create("scheme:example.com"),