Skip to content

Commit

Permalink
Merge master jdk-17.0.12+2 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed May 9, 2024
2 parents cd7617b + 390b876 commit 67f328c
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 121 deletions.
12 changes: 6 additions & 6 deletions make/conf/github-actions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ GTEST_VERSION=1.8.1
JTREG_VERSION=7.3.1+1

LINUX_X64_BOOT_JDK_EXT=tar.gz
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.6_10.tar.gz
LINUX_X64_BOOT_JDK_SHA256=a0b1b9dd809d51a438f5fa08918f9aca7b2135721097f0858cf29f77a35d4289
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz
LINUX_X64_BOOT_JDK_SHA256=aa7fb6bb342319d227a838af5c363bfa1b4a670c209372f9e6585bd79da6220c

WINDOWS_X64_BOOT_JDK_EXT=zip
WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_windows_hotspot_17.0.6_10.zip
WINDOWS_X64_BOOT_JDK_SHA256=d544c4f00d414a1484c0a5c1758544f30f308c4df33f9a28bd4a404215d0d444
WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_x64_windows_hotspot_17.0.11_9.zip
WINDOWS_X64_BOOT_JDK_SHA256=fdd6664d4131370398fbc8bfbb7b46dbfec4a22a090a511fe5c379dae188c390

MACOS_X64_BOOT_JDK_EXT=tar.gz
MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_mac_hotspot_17.0.6_10.tar.gz
MACOS_X64_BOOT_JDK_SHA256=faa2927584cf2bd0a35d2ac727b9f22725e23b2b24abfb3b2ac7140f4d65fbb4
MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jdk_x64_mac_hotspot_17.0.11_9.tar.gz
MACOS_X64_BOOT_JDK_SHA256=f8b96724618f4df557c47f11048d1084e98ed3eb87f0dbd5b84f768a80c3348e
47 changes: 26 additions & 21 deletions src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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
Expand Down Expand Up @@ -120,17 +120,15 @@
public final class Connection implements Runnable {

private static final boolean debug = false;
private static final int dump = 0; // > 0 r, > 1 rw


private final Thread worker; // Initialized in constructor

private boolean v3 = true; // Set in setV3()
private boolean v3 = true; // Set in setV3()

public final String host; // used by LdapClient for generating exception messages
// used by StartTlsResponse when creating an SSL socket
// used by StartTlsResponse when creating an SSL socket
public final int port; // used by LdapClient for generating exception messages
// used by StartTlsResponse when creating an SSL socket
// used by StartTlsResponse when creating an SSL socket

private boolean bound = false; // Set in setBound()

Expand Down Expand Up @@ -319,30 +317,37 @@ private SocketFactory getSocketFactory(String socketFactoryName) throws Exceptio
}

private Socket createConnectionSocket(String host, int port, SocketFactory factory,
int connectTimeout) throws Exception {
int connectTimeout) throws IOException {
Socket socket = null;

// if timeout is supplied, try to use unconnected socket for connecting with timeout
if (connectTimeout > 0) {
// create unconnected socket and then connect it if timeout
// is supplied
InetSocketAddress endpoint =
createInetSocketAddress(host, port);
// unconnected socket
socket = factory.createSocket();
// connect socket with a timeout
socket.connect(endpoint, connectTimeout);
if (debug) {
System.err.println("Connection: creating socket with " +
"a connect timeout");
System.err.println("Connection: creating socket with a connect timeout");
}
try {
// unconnected socket
socket = factory.createSocket();
} catch (IOException e) {
// unconnected socket is likely not supported by the SocketFactory
if (debug) {
System.err.println("Connection: unconnected socket not supported by SocketFactory");
}
}
if (socket != null) {
InetSocketAddress endpoint = createInetSocketAddress(host, port);
// connect socket with a timeout
socket.connect(endpoint, connectTimeout);
}
}

// either no timeout was supplied or unconnected socket did not work
if (socket == null) {
// create connected socket
socket = factory.createSocket(host, port);
if (debug) {
System.err.println("Connection: creating connected socket with" +
" no connect timeout");
System.err.println("Connection: creating connected socket with no connect timeout");
}
socket = factory.createSocket(host, port);
}
return socket;
}
Expand All @@ -351,7 +356,7 @@ private Socket createConnectionSocket(String host, int port, SocketFactory facto
// the SSL handshake following socket connection as part of the timeout.
// So explicitly set a socket read timeout, trigger the SSL handshake,
// then reset the timeout.
private void initialSSLHandshake(SSLSocket sslSocket , int connectTimeout) throws Exception {
private void initialSSLHandshake(SSLSocket sslSocket, int connectTimeout) throws Exception {

if (!IS_HOSTNAME_VERIFICATION_DISABLED) {
SSLParameters param = sslSocket.getSSLParameters();
Expand Down
24 changes: 18 additions & 6 deletions src/java.naming/share/classes/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2024, 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
Expand Down Expand Up @@ -36,21 +36,33 @@
* The following implementation specific environment properties are supported by the
* default LDAP Naming Service Provider implementation in the JDK:
* <ul>
* <li>{@code java.naming.ldap.factory.socket}:
* <br>The value of this environment property specifies the fully
* qualified class name of the socket factory used by the LDAP provider.
* This class must implement the {@link javax.net.SocketFactory} abstract class
* and provide an implementation of the static "getDefault()" method that
* returns an instance of the socket factory. By default the environment
* property is not set.
* </li>
* <li>{@code com.sun.jndi.ldap.connect.timeout}:
* <br>The value of this property is the string representation
* of an integer representing the connection timeout in
* milliseconds. If the LDAP provider cannot establish a
* connection within that period, it aborts the connection attempt.
* <br>The value of this environment property is the string representation
* of an integer specifying the connection timeout in milliseconds.
* If the LDAP provider cannot establish a connection within that period,
* it aborts the connection attempt.
* The integer should be greater than zero. An integer less than
* or equal to zero means to use the network protocol's (i.e., TCP's)
* timeout value.
* <br> If this property is not specified, the default is to wait
* for the connection to be established or until the underlying
* network times out.
* <br> If a custom socket factory is provided via environment property
* {@code java.naming.ldap.factory.socket} and unconnected sockets
* are not supported, the specified timeout is ignored
* and the provider behaves as if no connection timeout was set.
* </li>
* <li>{@code com.sun.jndi.ldap.read.timeout}:
* <br>The value of this property is the string representation
* of an integer representing the read timeout in milliseconds
* of an integer specifying the read timeout in milliseconds
* for LDAP operations. If the LDAP provider cannot get a LDAP
* response within that period, it aborts the read attempt. The
* integer should be greater than zero. An integer less than or
Expand Down
Loading

0 comments on commit 67f328c

Please sign in to comment.