Michael McMahon | 28 Aug 22:50 2015
Picon

RFR: 8087112: HTTP API and HTTP/1.1 implementation

Hi,

I'm looking for reviewers for the http client implementation.
This is just the common API layer and the http/1.1 implementation.

The webrev is at http://cr.openjdk.java.net/~michaelm/8087112/01/

Below is a description of the API classes and the relationship with
their implementation classes.

Thanks
Michael

---------------------------------------------------
java.net
---------------------------------------------------
HttpClient
||
\/
Client
||
\/
sun.net.httpclient.HtpClientImpl

HttpRequest
||
\/
Request
||
\/
(Continue reading)

Rob McKenna | 21 Aug 21:49 2015
Picon

RFR - 8087190: Regression in sun.net.util.IPAddressUtil.isIPv4LiteralAddress(String)

Hi folks, looking for a review for this simple change.

The change for https://bugs.openjdk.java.net/browse/JDK-8040747 
initialised each octet to 0. This meant that ... was translated to 
0.0.0.0 before checking the validity of the address.

This small change remedies that.

http://cr.openjdk.java.net/~robm/8087190/webrev.01/

I just noticed that I neglected to add 8087190 to the  <at> bug tag of 
textToNumericFormat.java. I'll do that pre-push.

	-Rob

Neon Ngo | 17 Aug 16:02 2015
Picon

JarURLConnection.getJarFile() resource leak when file is not found

The test program below shows a resource leak in java.net.JarURLConnection's getJarFile() when given an non-existent file to lookup in the jar file. Under Windows, the last printout shows that it is not able to remove the test input jar file.
Any input jar file can be used to test this as long as it does not contain "/testNonExistentFile.xyz" in the jar file. Warning, this test program will try to delete the input file, so use with a "temporary" copy of an existing jar file.

This happens under all current Oracle and OpenJDK Java versions: 6, 7, and 8 (I have not tried beta versions of 9).
I could not find a matching BUG for this issue on both the Oracle and OpenJDK websites.
So would like to start the conversation here since my submission on the Oracle website almost a month ago seems to have been lost.

Anyone know of a workaround for this issue?

Regards,

Neon
=== test.java ===
package nxm.test.lib;

import java.io.File;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.jar.JarFile;

public class test {

public static void getJarFile(String urlstr) throws Exception {
System.out.println("testing URL: " + urlstr);
URL url = new URL(urlstr);
URLConnection urlConnection = url.openConnection();
if (urlConnection instanceof JarURLConnection) {
JarURLConnection jarUrlConnection = (JarURLConnection) urlConnection;
JarFile jarFile = jarUrlConnection.getJarFile();
System.out.println(" Got JarFile : " + jarFile);
System.out.println(" JarFile.name : " + ((jarFile != null) ? jarFile.getName() : ""));
jarFile.close();
System.out.println(" Closed JarFile " + jarFile);

} else if (urlConnection != null) {
System.err.println(" URLConnection.class: " + urlConnection.getClass());
}
}

public static void main(String[] args) {
if (args.length < 1) {
error("Usage: <file.jar>");
}
String jarFilename = args[0];
File file = new File(jarFilename);
if (!file.exists()) {
error("input jar file does not exists: " + file);
}

String nonExistentFileInJar = "jar:file:" + jarFilename + "!/testNonExistentFile.xyz";
try {
getJarFile(nonExistentFileInJar);
} catch (Exception e) {
e.printStackTrace();
}

boolean result = file.delete();
System.out.println("Able to remove test jar file? " + result);

if (!result) {
error("Unable to remove test jar file: " + jarFilename);
}
}

static void error(String msg) {
System.err.println(msg);
System.exit(1);
}
}
=== end test.java ===
Rob McKenna | 11 Aug 20:08 2015
Picon

RFR: 8133015 - InetAddress.isReachable(tmout) returning wrong value on Windows for IPv6

Hi folks,

Upon investigating what turned out to be a network traffic filtering 
problem it was noticed that Windows InetAddress.isReachable() leverages 
TCP to detect other hosts on the network. Since new APIs for using ICMP 
have been implemented in Windows 2000 it could be helpful to support them.

This implementation removes the TCP call but it might make sense to keep 
that for redundancy. (though that could get messy when trying to take 
timeouts into account)

http://cr.openjdk.java.net/~robm/8133015/

	-Rob

Alexander Fomin | 29 Jul 13:59 2015
Picon

Review request: JDK-8080108: [TEST_BUG] ERROR: No IPv6 address returned from platform

Hello,

Please review the test bug fix
https://bugs.openjdk.java.net/browse/JDK-8080108

See webrev here
http://cr.openjdk.java.net/~kshefov/8080108/webrev.00/

The original test 
(com/sun/jndi/dns/IPv6NameserverPlatformParsingTest.java  <at> bug 6991580) 
fails automatically if /etc/resolv.conf file doesn't contain IPv6 
nameserver entries.
It's needed to edit /etc/resolv.conf manually before the test run, so 
this is a manual regression test.
The test is intended to be run on non-Windows systems.

Fix:
- provided standard test machinery for regression manual tests with 
instructions for a user;
- the test excluded for Windows.

Tested on Linux and Windows(to make sure it's excluded).

Thanks,
Alexander

Artem Smotrakov | 26 Jun 19:22 2015
Picon

[9] RFR: 8129444: "socksProxyVersion" system property is ignored if Socket(Proxy) constructor is used

Hello,

Please review this fix for 9.

If a socket was created with Socket(Proxy) constructor [1], then it doesn't take into account "socksProxyVersion" system property. As a result, it is not possible to use SOCKS v4 (v5 is used by default [2]). Currently the property is checked only in SocksSocketImpl.connect() method.

This fix updates SocksSocketImpl class to check "socksProxyVersion" system property when an instance is created, and in SocksSocketImpl.socksBind() method.

Bug: https://bugs.openjdk.java.net/browse/JDK-8129444
Webrev: http://cr.openjdk.java.net/~asmotrak/socks4/webrev.01/

[1] http://docs.oracle.com/javase/8/docs/api/java/net/Socket.html#Socket-java.net.Proxy-
[2] http://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html

Artem
Mark Sheppard | 24 Jun 17:34 2015
Picon

RFR: JDK-8129507 - sun/net/www/protocol/http/B6369510.java fails intermittently

Hi
    Please oblige and review the change below
which addresses the issue
https://bugs.openjdk.java.net/browse/JDK-8129507

This amends the url.openConnection() to take the Proxy.NO_PROXY argument,
so that a direct connection is made to test http server, thus bypassing 
any configured and enabled
http proxies on mac OS.

regards
Mark

-------------------------- changeset -------------------

diff -r 9a66ca9b7e36 test/sun/net/www/protocol/http/B6369510.java
--- a/test/sun/net/www/protocol/http/B6369510.java      Tue Jun 23 
14:20:59 2015 -0700
+++ b/test/sun/net/www/protocol/http/B6369510.java      Wed Jun 24 
13:00:49 2015 +0100
 <at>  <at>  -63,7 +63,7  <at>  <at> 

              // GET Request
              URL url = new URL("http://" + 
InetAddress.getLocalHost().getHostName() + ":" + address.getPort() + 
"/test/");
-            HttpURLConnection uc = (HttpURLConnection)url.openConnection();
+            HttpURLConnection uc = 
(HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
              int resp = uc.getResponseCode();
              if (resp != 200)
                  throw new RuntimeException("Failed: Response code from 
GET is not 200 RSP == " + resp);
 <at>  <at>  -71,7 +71,7  <at>  <at> 
              System.out.println("Response code from GET = 200 OK");

              //POST Request
-            uc = (HttpURLConnection)url.openConnection();
+            uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
              uc.setDoOutput(true);
              uc.setRequestMethod("POST");
              OutputStream os = uc.getOutputStream();

Pavel Rappo | 24 Jun 13:08 2015
Picon

[Preliminary] RFR JDK-8064925: URLConnection::getContent needs to be updated to work with modules

Hi everyone,

Could you please review my change for JDK-8064925?

http://cr.openjdk.java.net/~prappo/8064925/webrev.01/

The main goal is to see if the proposed spec change and the overall approach are
correct.

-------------------------------------------------------------------------------
So what has happened in this change?

1. java.net.URLConnection.getContentHandler method now looks for
ContentHandlerFactories also via ServiceLoader mechanism.

2. Existing image & audio handlers in java.desktop has been moved from
'sun.net.www.content' package to 'sun.awt.www.content'; A ContentHandlerFactory
called 'sun.awt.www.content.MultimediaContentHandlers' has been introduced to
help ServiceLoader to discover these handlers. 

P.S. All names described in (2) are subject to agreement with awt-dev@...

-Pavel

Brian Burkhalter | 22 Jun 23:56 2015
Picon

[9] RFR of 8129510: java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java should exclude testing the Teredo tunneling interface on Windows

Please review this test-only change at your convenience.

Patch: see diff below

The analysis in the comments on https://bugs.openjdk.java.net/browse/JDK-8042902 suggests that excluding testing of Teredo tunneling in this test might be appropriate and would produce a reliable test, hence this patch. Assuming that this is acceptable, the test should pass consistently and other issue could resolved as “Cannot Reproduce.”

Alternatively, the issue at hand may be inappropriate and applying the included diff could mask a real problem. If this latter is the consensus then this issue will be resolved as “Not an Issue."

Thanks,

Brian

— diff —

--- a/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java
+++ b/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java
<at> <at> -1,5 +1,5 <at> <at>
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
<at> <at> -49,6 +49,8 <at> <at>

 

     static boolean failed;

 

+    static boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+
     public static final int LOOPBACK_SCOPE_ID = 0;

 

     public static final byte[] IN6ADDR_ANY_INIT = { (byte) 0x00, (byte) 0x00,
<at> <at> -175,6 +177,13 <at> <at>
         for (Enumeration<NetworkInterface> e = NetworkInterface
                 .getNetworkInterfaces(); e.hasMoreElements();) {
             NetworkInterface netIF = e.nextElement();
+            // Skip (Windows)Teredo Tunneling Pseudo-Interface
+            if (isWindows) {
+                String dName = netIF.getDisplayName();
+                if (dName != null && dName.contains("Teredo")) {
+                    continue;
+                }
+            }
             for (Enumeration<InetAddress> iadrs = netIF.getInetAddresses(); iadrs
                     .hasMoreElements();) {
                 InetAddress iadr = iadrs.nextElement();
Brian Burkhalter | 22 Jun 22:03 2015
Picon

[9] RFR of 8129499: Structure of java/rmi/activation/rmidViaInheritedChannel tests masks exception

Please review at your convenience.

Issue:	https://bugs.openjdk.java.net/browse/JDK-8129499
Patch:	http://cr.openjdk.java.net/~bpb/8129499/webrev.00/

Summary: The instance variable ‘rmid’ is never initialized due to some error which occurs before the
statement which would initialize it but it is dereferenced in the finally block which causes any
exception within the try block to be suppressed.

This issue blocks obtaining further information from tests runs with respect to https://bugs.openjdk.java.net/browse/JDK-8077668.

Thanks,

Brian
Seán Coffey | 12 Jun 11:05 2015
Picon

RFR [8u-dev]:8072384:Setting IP_TOS on java.net sockets not working on unix

Michael,

I'd like to backport this fix to JDK 8u60. The port is pretty much the 
same as 9 except for modular path changes. The OptionsTest modified in 
jdk9 fix does not exist in jdk8u (test was for new API in JDK 9)

As a result, I was able to modify the jdk/net/Sockets/Test.java test 
instead. Only real way to test this in any case is via network snoops 
and they look good.

bug report : https://bugs.openjdk.java.net/browse/JDK-8072384
jdk 8u webrev : 
http://cr.openjdk.java.net/~coffeys/webrev.8072384.8u/webrev/

--

-- 
Regards,
Sean.


Gmane