You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/05/30 18:27:25 UTC
[tomcat-native] branch main updated: Update Java code to align with Tomcat 11
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git
The following commit(s) were added to refs/heads/main by this push:
new f1fb928d1 Update Java code to align with Tomcat 11
f1fb928d1 is described below
commit f1fb928d17e38e3d113551949ea77d694e52c5bc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue May 30 19:24:08 2023 +0100
Update Java code to align with Tomcat 11
---
java/org/apache/tomcat/jni/Library.java | 8 +++++---
java/org/apache/tomcat/jni/SSLContext.java | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java
index f22c32cb8..2fa3b07ec 100644
--- a/java/org/apache/tomcat/jni/Library.java
+++ b/java/org/apache/tomcat/jni/Library.java
@@ -22,6 +22,8 @@ public final class Library {
/* Default library names */
private static final String [] NAMES = {"tcnative-2", "libtcnative-2", "tcnative-1", "libtcnative-1"};
+ /* System property used to define CATALINA_HOME */
+ private static final String CATALINA_HOME_PROP = "catalina.home";
/*
* A handle to the unique Library singleton instance.
*/
@@ -30,13 +32,13 @@ public final class Library {
private Library() throws Exception {
boolean loaded = false;
StringBuilder err = new StringBuilder();
- File binLib = new File(System.getProperty("catalina.home"), "bin");
+ File binLib = new File(System.getProperty(CATALINA_HOME_PROP), "bin");
for (int i = 0; i < NAMES.length; i++) {
File library = new File(binLib, System.mapLibraryName(NAMES[i]));
try {
System.load(library.getAbsolutePath());
loaded = true;
- } catch (ThreadDeath | VirtualMachineError t) {
+ } catch (VirtualMachineError t) {
throw t;
} catch (Throwable t) {
if (library.exists()) {
@@ -59,7 +61,7 @@ public final class Library {
try {
System.loadLibrary(value);
loaded = true;
- } catch (ThreadDeath | VirtualMachineError t) {
+ } catch (VirtualMachineError t) {
throw t;
} catch (Throwable t) {
String name = System.mapLibraryName(value);
diff --git a/java/org/apache/tomcat/jni/SSLContext.java b/java/org/apache/tomcat/jni/SSLContext.java
index b26324f32..730a38ce8 100644
--- a/java/org/apache/tomcat/jni/SSLContext.java
+++ b/java/org/apache/tomcat/jni/SSLContext.java
@@ -360,7 +360,7 @@ public final class SSLContext {
* select an OpenSSL SSLContext based on the host name requested by the
* client.
*/
- public static interface SNICallBack {
+ public interface SNICallBack {
/**
* This callback is made during the TLS handshake when the client uses
@@ -373,7 +373,7 @@ public final class SSLContext {
* SSLContext to use for the given host or zero if no SSLContext
* could be identified
*/
- public long getSslContext(String sniHostName);
+ long getSslContext(String sniHostName);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org