This is an automated email from the ASF dual-hosted git repository.

markt-asf 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 37339bca0 Remove more unused code
37339bca0 is described below

commit 37339bca0dd33776366d8fe6bf8bc6688b1ba614
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Aug 27 12:36:06 2026 +0100

    Remove more unused code
    
    This is expected to be the final commit removing unused code for this
    branch for the time being.
---
 native/include/tcn.h    | 3 ---
 native/src/ssl.c        | 5 -----
 native/src/sslcontext.c | 5 ++---
 native/src/sslutils.c   | 4 ++--
 4 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/native/include/tcn.h b/native/include/tcn.h
index 0e73c562b..e933945ec 100644
--- a/native/include/tcn.h
+++ b/native/include/tcn.h
@@ -102,9 +102,6 @@ unsigned long   tcn_get_thread_id(void);
         }                                       \
     TCN_END_MACRO
 
-#define TCN_THROW_OS_ERROR(E)   \
-    tcn_ThrowAPRException((E), apr_get_os_error())
-
 #define TCN_LOAD_CLASS(E, C, N, R)                  \
     TCN_BEGIN_MACRO                                 \
         jclass _##C = (*(E))->FindClass((E), N);    \
diff --git a/native/src/ssl.c b/native/src/ssl.c
index 167827d15..6e0973733 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -176,17 +176,13 @@ TCN_IMPLEMENT_CALL(jint, SSL, initialize)(TCN_STDARGS, 
jstring engine)
     jclass clazz;
     jclass sClazz;
 
-    TCN_ALLOC_CSTRING(engine);
-
     UNREFERENCED(o);
     if (!tcn_global_pool) {
-        TCN_FREE_CSTRING(engine);
         tcn_ThrowAPRException(e, APR_EINVAL);
         return (jint)APR_EINVAL;
     }
     /* Check if already initialized */
     if (ssl_initialized++) {
-        TCN_FREE_CSTRING(engine);
         return (jint)APR_SUCCESS;
     }
 
@@ -205,7 +201,6 @@ TCN_IMPLEMENT_CALL(jint, SSL, initialize)(TCN_STDARGS, 
jstring engine)
     apr_pool_cleanup_register(tcn_global_pool, NULL,
                               ssl_init_cleanup,
                               apr_pool_cleanup_null);
-    TCN_FREE_CSTRING(engine);
 
     /* Cache the byte[].class for performance reasons */
     clazz = (*e)->FindClass(e, "[B");
diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index 094e3dcd1..dd2337eb0 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -993,8 +993,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, 
addClientCACertificateRaw)(TCN_STDARGS,
 /* Start of netty-tc-native add */
 
 /* Convert protos to wire format */
-static int initProtocols(JNIEnv *e, const tcn_ssl_ctxt_t *c, unsigned char 
**proto_data,
-            unsigned int *proto_len, jobjectArray protos) {
+static int initProtocols(JNIEnv *e, unsigned char **proto_data, unsigned int 
*proto_len, jobjectArray protos) {
     int i;
     unsigned char *p_data;
     /*
@@ -1089,7 +1088,7 @@ TCN_IMPLEMENT_CALL(void, SSLContext, 
setAlpnProtos)(TCN_STDARGS, jlong ctx, jobj
     TCN_ASSERT(ctx != 0);
     UNREFERENCED(o);
 
-    if (initProtocols(e, c, &c->alpn_proto_data, &c->alpn_proto_len, 
alpn_protos) == 0) {
+    if (initProtocols(e, &c->alpn_proto_data, &c->alpn_proto_len, alpn_protos) 
== 0) {
         c->alpn_selector_failure_behavior = selectorFailureBehavior;
 
         // depending on if it's client mode or not we need to call different 
functions.
diff --git a/native/src/sslutils.c b/native/src/sslutils.c
index 8f9ad3f92..6f22cb912 100644
--- a/native/src/sslutils.c
+++ b/native/src/sslutils.c
@@ -389,7 +389,7 @@ int SSL_callback_SSL_verify(int ok, X509_STORE_CTX *ctx)
 /* The code here is inspired by nghttp2
  *
  * See 
https://github.com/tatsuhiro-t/nghttp2/blob/ae0100a9abfcf3149b8d9e62aae216e946b517fb/src/shrpx_ssl.cc#L244
 */
-int select_next_proto(SSL *ssl, const unsigned char **out, unsigned char 
*outlen,
+static int select_next_proto(const unsigned char **out, unsigned char *outlen,
         const unsigned char *in, unsigned int inlen, unsigned char 
*supported_protos,
         unsigned int supported_protos_len, int failure_behavior) {
 
@@ -448,7 +448,7 @@ int select_next_proto(SSL *ssl, const unsigned char **out, 
unsigned char *outlen
 int SSL_callback_alpn_select_proto(SSL* ssl, const unsigned char **out, 
unsigned char *outlen,
         const unsigned char *in, unsigned int inlen, void *arg) {
     tcn_ssl_ctxt_t *ssl_ctxt = arg;
-    return select_next_proto(ssl, out, outlen, in, inlen, 
ssl_ctxt->alpn_proto_data, ssl_ctxt->alpn_proto_len, 
ssl_ctxt->alpn_selector_failure_behavior);
+    return select_next_proto(out, outlen, in, inlen, 
ssl_ctxt->alpn_proto_data, ssl_ctxt->alpn_proto_len, 
ssl_ctxt->alpn_selector_failure_behavior);
 }
 #ifdef HAVE_OCSP
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to