This fix updates `java/net/DatagramSocket/SendReceiveMaxSize.java` and `java/net/DatagramSocket/SendReceiveMaxSize.java` to check (on all platforms) that the sending/receiving of large datagrams across a network are sent, fragmented, and re-assembled correctly
Reviewed-by: alanb, dfuchs
SO_RCVBUF was previously set to match the SO_SNDBUF, however the kernel value for SO_RCVBUF is much larger. This mismatch caused the test to fail, and the fix removes this issue.
Reviewed-by: alanb, dfuchs
SocketTube is fixed to cater for errors caused by pausing/resuming events on an asynchronously closed connection, from within the selector's manager thread. Http2Connection and Stream are fixed to prevent sending a DataFrame on a stream after Reset has been sent.
Reviewed-by: chegar
TransportImpl is modified to make sure the CLOSED state is recorded before the channel is closed. The tests are modified to enable their retry mechanism on windows, similar to what was done previously for macOS.
Reviewed-by: prappo, chegar
The `test java/net/DatagramSocket/SendReceiveMaxSize` is currently failing when run with `-Djdk.net.usePlainDatagramSocketImpl` and `-Djava.net.preferIPv4Stack=true`. This fix removes these run settings from the test until a more permanent solution can be found.
Reviewed-by: dfuchs
This fix changes the current max size for IPv6 datagrams on macOS from it's current size of 65507, which is the IPv4 limit, to 65527, the actual limit for IPv6 on macOS
Reviewed-by: alanb, dfuchs, vtewari
This fix updates these tests to explicitly run with `-Djdk.net.usePlainDatagramSocketImpl=false` to avoid false failures when running all tests with a global jtreg -Djdk.net.usePlainDatagramSocketImpl switch.
Reviewed-by: vtewari
This fix removes NetworkPermission checks that were made redundant in jdk/net/ExtendedSocketOptions after the socket option SO_FLOW_SLA was removed.
Reviewed-by: alanb
This fix clarifies the behaviours of constructors from DatagramSocket and MulticastSocket when no address or a null address is supplied.
Reviewed-by: dfuchs
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
This patch updates the @modules tag with +open in the tests UnreferencedDatagramSockets and UnreferncedMulticastSockets in advance of the removal of --illegal-access to allow access to private member fields required by the tests.
Reviewed-by: alanb, dfuchs
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
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
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
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
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
The fix updates jdk.internal.net.http.websocket. OpeningHandshake.send() method to process the response body from server
Reviewed-by: chegar, dfuchs, prappo
Tests added for methods: setSendBufferSize(int), getSendBufferSize(), and getReceieveBufferSize() to increase test coverage in the DatagramSocket class
Reviewed-by: alanb, chegar, dfuchs
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
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
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
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
The fix updates the incorrect example of the usage of the class java.net.http.HttpResponse.BodySubscribers.
Reviewed-by: chegar, dfuchs, jboes, pconcannon
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
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
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
The SSLTube and SSLFlowDelegate are improved to wrap any non-SSL exception that occur during the handshake in an SSLHandshakeException.
Reviewed-by: chegar
DatagramSocket and MulticastSocket changed to throw IllegalArgumentException if not connected and passed a packet containing a port out of range
Reviewed-by: chegar, dfuchs
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
The MulticastSocket method getOption has been changed to conform to the behavior described in StandardSocketOptions.IP_MULTICAST_IF.
Reviewed-by: chegar, dfuchs
MulticastSocket.getOption(StandardSocketOption.IP_MULTICAST_LOOP) now returns true if loopback mode is enabled, and MulticastSocket.setOption(StandardSocketOption.IP_MULTICAST_LOOP, true) enables loopback mode. No other behavioral changes.
Reviewed-by: alanb, chegar
DatagramSocket had a setBroadcast and getBroadcast setter/getter pair but curiously didn't report SO_BROADCAST as a supported option. Note: the source code changes were accidentally pushed with 8234103 so this changeset only has the test changes. The reviewers listed below had already reviewed the full (source+test) changes.
Reviewed-by: alanb, vtewari, chegar
DatagramSocket and MulticastSocket send methods are changed to throw IllegalArgumentException if no target address can be determined.
Reviewed-by: alanb
This fix adds an IPv4 version of test SetLoopbackMode.java that calls SetLoopbackMode in IPv4 only mode, and runs only if IPv4 is enabled.
Reviewed-by: dfuchs
When enabled, HttpClient redirect is fixed to drop the body when the request method is changed, and to relay any redirection code it does not understand to the caller.
Reviewed-by: chegar
SSLFlowDelegate.Reader and SubscriberWrapper are changed to better cooperate on when more demand should be requested from upstream. The issue encountered in this scenario was triggered by a large certificate which caused the SSLFlowDelegate to stop requesting data from upstream during the handshake although the engine handshake status was NEED_UNWRAP.
Reviewed-by: chegar
Fixes tests to use the loopback address whenever possible. It also fixes some safe publishing issues, or add diagnostics in some of the tests.
Reviewed-by: michaelm