Commit Graph

256 Commits

Author SHA1 Message Date
Patrick Concannon
d071ed0294 8244582: Remove terminally deprecated Solaris-specific SO_FLOW_SLA socket option
This patch removes ExtendedSocketOptions.SO_FLOW_SLA, SocketFlow and SocketFlow.Status which were terminally deprecated in JDK 14 in preparation for the removal of the Solaris port.

Reviewed-by: alanb, dfuchs, chegar, vtewari
2020-06-05 09:35:42 +01:00
Aleksei Efimov
02fbf44cc7 8244958: preferIPv4Stack and preferIPv6Addresses do not affect addresses returned by HostsFileNameService
Reviewed-by: dfuchs, alanb, vtewari
2020-05-29 13:39:16 +01:00
Julia Boes
c0a1a4e4fc 8237470: HttpResponse.BodySubscriber::ofFile throws UOE with non-default file systems
Rework non-default file system paths of BodySubscriber::ofFile and BodyHandler::ofFile and fix BodyHandler::ofFileDownload to throw consistently for non-default file system paths

Reviewed-by: dfuchs, chegar
2020-05-29 12:59:13 +01:00
Patrick Concannon
4708c6d343 8243507: DatagramSocket constructors don’t always specify what happens when passed invalid parameters
This fix updates the spec for DatagramSocket's constructors to inform the user of the Exceptions thrown when an invalid argument is passed.

Reviewed-by: dfuchs
2020-05-29 11:08:09 +01:00
Vladimir A Ivanov
4aa057013c 8245517: java/net/SocketOption/AfterClose.java fails with Invalid value 'READ_ONLY'
Reviewed-by: dfuchs, pconcannon
2020-05-22 10:25:40 -07:00
Mikael Vidstedt
071bd521bc 8244224: Implementation of JEP 381: Remove the Solaris and SPARC Ports
Reviewed-by: alanb, bchristi, dcubed, dfuchs, eosterlund, erikj, glaubitz, ihse, iignatyev, jjiang, kbarrett, ksrini, kvn, naoto, prr, rriggs, serb, sspitsyn, stefank, tschatzl, valeriep, weijun, weijun
2020-05-20 17:33:37 -07:00
Vladimir A Ivanov
93fcbec20a 8243099: SO_INCOMING_NAPI_ID support
Add support for the SO_INCOMING_NAPI_ID socket option to jdk.net.ExtendedSocketOptions

Co-authored-by: Dinesh Kumar <dinesh.kumar@intel.com>
Reviewed-by: alanb, chegar, dfuchs, vtewari, pconcannon
2020-05-20 15:12:28 -07:00
Daniel Fuchs
58adc04d69 8244031: HttpClient should have more tests for HEAD requests
Http2TestExchangeImpl.java updated to support HEAD responses; ForbiddenHeadTest.java added.

Reviewed-by: chegar, michaelm
2020-05-20 18:57:06 +01:00
Patrick Concannon
fad2cf51ba 8241072: Reimplement the Legacy DatagramSocket API
Replace the underlying implementations of the java.net.DatagramSocket and java.net.MulticastSocket APIs with simpler and more modern implementations that are easy to maintain and debug.

Co-authored-by: Alan Bateman <alan.bateman@oracle.com>
Co-authored-by: Chris Hegarty <chris.hegarty@oracle.com>
Co-authored-by: Daniel Fuchs <daniel.fuchs@oracle.com>
Reviewed-by: alanb, chegar, dfuchs
2020-05-12 21:51:53 +01:00
Rahul Yadav
178e69a3b9 8244652: Add test for non utf-8 response handling by websocket
The test java.net.httpclient.websocket.WSHandshakeExceptionTest.java checks that the websocket client handles invalid utf-8 sent by the websocket server

Reviewed-by: dfuchs
2020-05-15 14:46:17 +01:00
Daniel Fuchs
a2c35a6acb 8244205: HTTP/2 tunnel connections through proxy may be reused regardless of which proxy is selected
The key used in the HTTP/2 connection pool is updated to take into account the proxy address in case of tunnel connections

Reviewed-by: chegar
2020-05-06 19:19:38 +01:00
Rahul Yadav
ed24927500 8240666: Websocket client’s OpeningHandshake discards the HTTP response body
The fix updates jdk.internal.net.http.websocket. OpeningHandshake.send() method to process the response body from server

Reviewed-by: chegar, dfuchs, prappo
2020-05-06 17:33:32 +01:00
Patrick Concannon
469c13a86d 8243488: Add tests for set/get SendBufferSize and getReceiveBufferSize in DatagramSocket
Tests added for methods: setSendBufferSize(int), getSendBufferSize(), and getReceieveBufferSize() to increase test coverage in the DatagramSocket class

Reviewed-by: alanb, chegar, dfuchs
2020-05-05 18:34:39 +01:00
Rahul Yadav
184b433630 8242999: HTTP/2 client may not handle CONTINUATION frames correctly
Updated jdk.internal.net.http.Stream.incoming(Http2Frame frame) to handle continuation frame with END_HEADER flag

Reviewed-by: chegar, dfuchs
2020-04-28 10:30:27 +01:00
Daniel Fuchs
94a99ab9e5 8243246: HTTP Client sometimes gets java.io.IOException -> Invalid chunk header byte 32
The HTTP/1 chunked body parser is updated to discard chunk extensions

Reviewed-by: chegar, alanb
2020-04-24 16:54:30 +01:00
Patrick Concannon
42d2a7411b 8243408: Inconsistent Exceptions are thrown by MulticastSocket when sending a DatagramPacket to port 0
This fix adds a check for port == 0 to MulticastSocket's 2-arg send method to ensure a consistent exception is thrown across platforms

Reviewed-by: dfuchs
2020-04-22 20:41:56 +01:00
Patrick Concannon
8e21a2a1e4 8237890: DatagramPacket::getSocketAddress doesn't specify what happens if address or port are not set
This fix changes the default port of a DatagramPacket from -1 to 0, which changes the behaviour of calling getSocketAddress with no port set from throwing an IAE to returning an InetSocketAddress representing any local address with port 0.

Reviewed-by: alanb, chegar, dfuchs
2020-04-22 12:34:09 +01:00
Daniel Fuchs
da1abd18db 8238270: java.net HTTP/2 client does not decrease stream count when receives 204 response
The HTTP/2 Stream is updated to register a trivial data subscriber in case of 204 so that the END_STREAM is correctly processed.

Reviewed-by: chegar
2020-04-20 13:15:45 +01:00
Henry Jen
0278846eaa Merge 2020-04-14 23:11:49 +00:00
Rahul Yadav
86722cb038 8239594: jdk.tls.client.protocols is not respected
8239595: ssl context version is not respected

The java.net.HttpClient is updated to no longer override any default selected protocols in the SSLContext, in the absence of  any SSLParameters explicitly supplied to the HttpClient.builder.

Reviewed-by: chegar, dfuchs
2020-04-10 10:05:33 +01:00
Patrick Concannon
378aef32ab 8240533: Inconsistent Exceptions are thrown by DatagramSocket and DatagramChannel when sending a DatagramPacket to port 0
Fix adds checks for port == 0 to the send and connect methods in DatagramSocket and DatagramChannelImpl

Reviewed-by: alanb, chegar, dfuchs, lancea
2020-04-07 16:21:01 +01:00
Jaikiran Pai
59af1c2af4 8241138: http.nonProxyHosts=* causes StringIndexOutOfBoundsException in DefaultProxySelector
Reviewed-by: dfuchs, chegar
2020-03-24 15:47:51 +05:30
Daniel Fuchs
f541970b31 8241786: Improve heuristic to determine default network interface on macOS
DefaultInetrface.getDefault is updated to prefer interfaces that have non link-local addresses. NetworkConfiguration is updated to skip interface that have only link-local addresses, whether IPv4 or IPv6, for multicasting.

Reviewed-by: chegar, alanb
2020-04-03 14:27:03 +01:00
Chris Hegarty
9a69bb807b 8242044: Add basic HTTP/1.1 support to the HTTP/2 Test Server
Reviewed-by: dfuchs, michaelm
2020-04-03 07:27:53 +01:00
Chris Hegarty
61940fe4ce 8241988: DatagramSocket incorrectly caches the first set of socket options
Reviewed-by: msheppar, dfuchs, alanb
2020-04-03 07:16:35 +01:00
Daniel Fuchs
5ddbcb7a51 8241336: Some java.net tests failed with NoRouteToHostException on MacOS with special network configuration
NetworkConfiguration updated to skip interfaces that have only IPv6 link local addresses.

Reviewed-by: alanb, chegar
2020-03-27 12:42:03 +00:00
Julia Boes
eb7c80a308 8241674: Fix incorrect jtreg option in FilePublisherPermsTest
Replace jtreg option 'policy' with 'java.security.policy' to extend rather than replace policy

Reviewed-by: chegar, dfuchs
2020-03-26 14:58:53 +00:00
Julia Boes
d882d528bb 8235459: HttpRequest.BodyPublishers::ofFile assumes the default file system
Add support for non-default file systems to HttpRequest.BodyPublishers::ofFile

Reviewed-by: chegar, dfuchs, amlu
2020-03-26 11:52:15 +00:00
Rahul Yadav
c5a7490809 8240921: Minor correction to HttpResponse.BodySubscribers example
The fix updates the incorrect example of the usage of the class java.net.http.HttpResponse.BodySubscribers.

Reviewed-by: chegar, dfuchs, jboes, pconcannon
2020-03-20 20:16:34 +00:00
Daniel Fuchs
58337b12f8 8059309: network tests fail with "java.net.SocketException: Couldn't obtain phys addr" when run as "root"
The solaris specific code is changed to use the fallback mechanism if the DLPI interface returns an error indicating that the operation is unsupported. In addition, NetworkInterface::getHardwareAddress is changed to always return null for the loopback interface.

Reviewed-by: alanb
2020-03-12 18:31:49 +00:00
Patrick Concannon
0ed44d0aee 8239355: (dc) Initial value of SO_SNDBUF should allow sending large datagrams (macOS)
Updates DatagramChannel so that the SO_SNDBUF is set to a minimum value of 65527 for IPv6 sockets and 65507 for IPv4 sockets on macOS.

Reviewed-by: alanb, dfuchs
2020-03-12 17:08:09 +00:00
John Jiang
edaf548beb 8238740: java/net/httpclient/whitebox/FlowTestDriver.java would not specify a TLS protocol
Reviewed-by: dfuchs
2020-03-10 21:43:46 +08:00
Daniel Fuchs
5c8f935641 8240754: Instrument FlowTest.java to provide more debug traces
Reviewed-by: chegar
2020-03-09 17:48:40 +00:00
Ravi Reddy
b2f1f73e75 8183369: RFC unconformity of HttpURLConnection with proxy
HttpURLConnection retried with proxy if the connection fails on first attempt as per RFC

Reviewed-by: chegar, dfuchs, vtewari
2020-03-05 03:27:17 -05:00
Daniel Fuchs
f7c819a72d 8239052: java/net/httpclient/whitebox/SSLEchoTubeTestDriver.java failed with BufferUnderflowException against TLSv1.3
The test assumed that ByteBuffer would be split at long boundaries. This is obviously not always the case. A carry has been added to support reading a long split over several buffers.

Reviewed-by: chegar
2020-02-24 17:19:32 +00:00
Daniel Fuchs
f40220f578 8238990: java/net/httpclient/HandshakeFailureTest.java failed against TLSv1.3 on Windows
The SSLTube and SSLFlowDelegate are improved to wrap any non-SSL exception that occur during the handshake in an SSLHandshakeException.

Reviewed-by: chegar
2020-02-20 20:04:15 +00:00
John Jiang
446f59a26c 8234718: java/net/httpclient tests should cover TLSv1.3
Reviewed-by: dfuchs
2020-02-13 21:42:31 +08:00
John Jiang
fbca3fa710 8238677: java/net/httpclient/ssltest/CertificateTest.java should not specify TLS version
Reviewed-by: dfuchs
2020-02-11 08:36:02 +08:00
Patrick Concannon
00c40ae1e3 7021373: DatagramPacket exception conditions are not clear
Specification is clarified by adding or clarifying @throws clauses where required

Reviewed-by: alanb, chegar, darcy, dfuchs
2020-02-07 11:10:41 +00:00
Daniel Fuchs
b069da31e0 8238231: Custom DatagramSocketImpl's create method not called when with protected constructor
Allow the socket to be lazily created if not created by the constructor.

Reviewed-by: alanb
2020-02-04 18:35:37 +00:00
Mikael Vidstedt
3318314c7c 8237589: Fix copyright header formatting
Reviewed-by: jjg, serb, iris, jwilhelm
2020-01-21 14:23:01 -08:00
Patrick Concannon
d2cd7a5096 8237571: java/net/DatagramSocket/SendCheck.java is failing on Solaris
Commented out failing testcase as this is being tracked by JDK-8236852

Reviewed-by: dfuchs
2020-01-21 18:38:46 +00:00
Patrick Concannon
2f76772fa9 8236105: Behaviors of DatagramSocket/DatagramChannel::socket send methods are not always consistent
DatagramSocket and MulticastSocket changed to throw IllegalArgumentException if not connected and passed a packet containing a port out of range

Reviewed-by: chegar, dfuchs
2020-01-20 16:24:05 +00:00
Daniel Fuchs
c6da6681d4 8236859: WebSocket over authenticating proxy fails with NPE
This change fixes several issues with WebSocket and proxy authentication. The AuthenticationFilter is changed to support an authenticating server accessed through an authenticating proxy. MultiExchange is fixed to close the previous connection if a new connection is necessary to establish the websocket (websocket connections are not cached and must be closed in that case). WebSocket OpeningHandshake is fixed to close the connection (without creating the RawChannel) if the opening handshake doesn't result in 101 upgrade protocol.

Reviewed-by: prappo, chegar
2020-01-17 17:55:06 +00:00
Jesper Wilhelmsson
257a1bb854 Merge 2020-01-08 16:03:32 +01:00
Chris Hegarty
417672bc9d 8236441: Bound MulticastSocket fails when setting outbound interface on Windows
Reviewed-by: alanb
2019-12-23 09:17:00 +00:00
Daniel Fuchs
ad09813035 8233245: More adaptive sockets
Reviewed-by: chegar, igerasim, alanb, skoivu, rhalade
2019-12-09 20:33:15 +00:00
Ivan Gerasimov
6c16f55fde 8231785: Improved socket permissions
Reviewed-by: ahgross, chegar, mullan, rhalade
2019-10-23 17:03:07 -07:00
Kiran Sidhartha Ravikumar
a1b2e1042c 5064980: URI compareTo inconsistent with equals for mixed-case escape sequences
Reviewed-by: chegar, dfuchs
2019-12-17 16:06:27 +00:00
Daniel Fuchs
e16d4a45b0 8235925: java/net/Socket/HttpProxy.java fails on IPv4 only hosts and other small cleanups
HttpProxy test is fixed to take into account the possibility that the host may be configured with IPv4 only

Reviewed-by: chegar
2019-12-17 16:11:16 +01:00