8214014: Remove vestiges of gopher: protocol proxy support
authorrriggs
Wed, 28 Nov 2018 16:04:36 -0500
changeset 52725 c470f977ade8
parent 52724 0bdbf854472f
child 52726 9cfa2e273b77
8214014: Remove vestiges of gopher: protocol proxy support Reviewed-by: lancea, alanb
src/java.base/macosx/native/libjava/java_props_macosx.c
src/java.base/share/classes/jdk/internal/util/SystemProps.java
src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java
src/java.base/share/conf/net.properties
src/java.base/share/native/libjava/System.c
src/java.base/share/native/libjava/java_props.h
src/java.base/unix/native/libnet/DefaultProxySelector.c
src/java.base/windows/native/libnet/DefaultProxySelector.c
test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java
test/jdk/java/net/ProxySelector/SystemProxies.java
test/jdk/java/net/URI/Test.java
test/jdk/java/net/httpclient/RequestBuilderTest.java
--- a/src/java.base/macosx/native/libjava/java_props_macosx.c	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/macosx/native/libjava/java_props_macosx.c	Wed Nov 28 16:04:36 2018 -0500
@@ -417,13 +417,11 @@
     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 @@
     CHECK_PROXY(https, HTTPS);
     CHECK_PROXY(ftp, FTP);
     CHECK_PROXY(socks, SOCKS);
-    CHECK_PROXY(gopher, Gopher);
 
 #undef CHECK_PROXY
 
--- a/src/java.base/share/classes/jdk/internal/util/SystemProps.java	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/util/SystemProps.java	Wed Nov 28 16:04:36 2018 -0500
@@ -85,9 +85,6 @@
         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 @@
         @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;
--- a/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java	Wed Nov 28 16:04:36 2018 -0500
@@ -53,7 +53,6 @@
  *
  * 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 @@
         {"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 @@
             return 80;
         } else if ("socket".equalsIgnoreCase(protocol)) {
             return 1080;
-        } else if ("gopher".equalsIgnoreCase(protocol)) {
-            return 80;
         } else {
             return -1;
         }
--- a/src/java.base/share/conf/net.properties	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/share/conf/net.properties	Wed Nov 28 16:04:36 2018 -0500
@@ -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 @@
 # 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 @@
 # 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 @@
 # 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
--- a/src/java.base/share/native/libjava/System.c	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/share/native/libjava/System.c	Wed Nov 28 16:04:36 2018 -0500
@@ -184,15 +184,6 @@
         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) {
--- a/src/java.base/share/native/libjava/java_props.h	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/share/native/libjava/java_props.h	Wed Nov 28 16:04:36 2018 -0500
@@ -106,10 +106,6 @@
     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 */
--- a/src/java.base/unix/native/libnet/DefaultProxySelector.c	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/unix/native/libnet/DefaultProxySelector.c	Wed Nov 28 16:04:36 2018 -0500
@@ -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
@@ -224,18 +222,6 @@
             }
 
             /**
-             * 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 ]
              * /system/proxy/socks_host (string)
--- a/src/java.base/windows/native/libnet/DefaultProxySelector.c	Wed Nov 28 15:53:49 2018 -0500
+++ b/src/java.base/windows/native/libnet/DefaultProxySelector.c	Wed Nov 28 16:04:36 2018 -0500
@@ -296,8 +296,7 @@
 
         /* 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;
--- a/test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java	Wed Nov 28 15:53:49 2018 -0500
+++ b/test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java	Wed Nov 28 16:04:36 2018 -0500
@@ -271,7 +271,7 @@
     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();
     }
 
--- a/test/jdk/java/net/ProxySelector/SystemProxies.java	Wed Nov 28 15:53:49 2018 -0500
+++ b/test/jdk/java/net/ProxySelector/SystemProxies.java	Wed Nov 28 16:04:36 2018 -0500
@@ -53,7 +53,6 @@
         printProxies("https://");
         printProxies("ftp://");
         printProxies("none://");
-        printProxies("gopher://");
         printProxies("rtsp://");
         printProxies("socket://");
     }
--- a/test/jdk/java/net/URI/Test.java	Wed Nov 28 15:53:49 2018 -0500
+++ b/test/jdk/java/net/URI/Test.java	Wed Nov 28 16:04:36 2018 -0500
@@ -682,10 +682,6 @@
         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();
 
--- a/test/jdk/java/net/httpclient/RequestBuilderTest.java	Wed Nov 28 15:53:49 2018 -0500
+++ b/test/jdk/java/net/httpclient/RequestBuilderTest.java	Wed Nov 28 16:04:36 2018 -0500
@@ -107,7 +107,6 @@
                 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"),