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

rainerjung pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-connectors.git


The following commit(s) were added to refs/heads/main by this push:
     new 4f51ce32f Remove unused Apache 1.3 EBCDIC support; Apache 2.0 EBCDIC 
remains
4f51ce32f is described below

commit 4f51ce32f3fd87599a1a598044513042b6369681
Author: Rainer Jung <[email protected]>
AuthorDate: Wed Jun 24 21:33:47 2026 +0200

    Remove unused Apache 1.3 EBCDIC support; Apache 2.0 EBCDIC remains
---
 native/common/jk_global.h | 11 -----------
 native/common/jk_md5.c    | 36 ------------------------------------
 native/common/jk_url.c    | 15 ---------------
 3 files changed, 62 deletions(-)

diff --git a/native/common/jk_global.h b/native/common/jk_global.h
index f0390a181..677783551 100644
--- a/native/common/jk_global.h
+++ b/native/common/jk_global.h
@@ -300,22 +300,11 @@ extern "C"
 
 #else                           /* APR_CHARSET_EBCDIC */
 
-/* Check for Apache 1.3 running on an EBCDIC system */
-#ifdef CHARSET_EBCDIC
-
-#define USE_CHARSET_EBCDIC
-#define jk_xlate_to_ascii(b, l) ebcdic2ascii(b, b, l)
-#define jk_xlate_from_ascii(b, l) ascii2ebcdic(b, b, l)
-
-#else                           /* CHARSET_EBCDIC */
-
 /* We're in on an ASCII system */
 
 #define jk_xlate_to_ascii(b, l) /* NOOP */
 #define jk_xlate_from_ascii(b, l)       /* NOOP */
 
-#endif                          /* CHARSET_EBCDIC */
-
 #endif                          /* APR_CHARSET_EBCDIC */
 
 /* on i5/OS V5R4 HTTP/APR APIs and Datas are in UTF */
diff --git a/native/common/jk_md5.c b/native/common/jk_md5.c
index 60372a992..25ff1b3c5 100644
--- a/native/common/jk_md5.c
+++ b/native/common/jk_md5.c
@@ -201,7 +201,6 @@ static void jk_MD5Update(JK_MD5_CTX * context, const 
unsigned char *input,
     partLen = 64 - idx;
 
     /* Transform as many times as possible. */
-#ifndef CHARSET_EBCDIC
     if (inputLen >= partLen) {
         memcpy(&context->buffer[idx], input, partLen);
         MD5Transform(context->state, context->buffer);
@@ -218,26 +217,6 @@ static void jk_MD5Update(JK_MD5_CTX * context, const 
unsigned char *input,
 
     /* Buffer remaining input */
     memcpy(&context->buffer[idx], &input[i], inputLen - i);
-#else /*CHARSET_EBCDIC */
-    if (inputLen >= partLen) {
-        ebcdic2ascii(&context->buffer[idx], input, partLen);
-        MD5Transform(context->state, context->buffer);
-
-        for (i = partLen; i + 63 < inputLen; i += 64) {
-            unsigned char inp_tmp[64];
-            ebcdic2ascii(inp_tmp, &input[i], 64);
-            MD5Transform(context->state, inp_tmp);
-        }
-
-        idx = 0;
-    }
-    else {
-        i = 0;
-    }
-
-    /* Buffer remaining input */
-    ebcdic2ascii(&context->buffer[idx], &input[i], inputLen - i);
-#endif /*CHARSET_EBCDIC */
 }
 
 /* MD5 finalization. Ends an MD5 message-digest operation, writing the
@@ -252,21 +231,6 @@ static void JK_METHOD jk_MD5Final(unsigned char 
digest[16], JK_MD5_CTX * context
     /* Save number of bits */
     Encode(bits, context->count, 8);
 
-#ifdef CHARSET_EBCDIC
-    /* XXX: @@@: In order to make this no more complex than necessary,
-     * this kludge converts the bits[] array using the ascii-to-ebcdic
-     * table, because the following jk_MD5Update() re-translates
-     * its input (ebcdic-to-ascii).
-     * Otherwise, we would have to pass a "conversion" flag to jk_MD5Update()
-     */
-    ascii2ebcdic(bits, bits, 8);
-
-    /* Since everything is converted to ascii within jk_MD5Update(),
-     * the initial 0x80 (PADDING[0]) must be stored as 0x20
-     */
-    ascii2ebcdic(PADDING, PADDING, 1);
-#endif /*CHARSET_EBCDIC */
-
     /* Pad out to 56 mod 64. */
     idx = (size_t) ((context->count[0] >> 3) & 0x3f);
     padLen = (idx < 56) ? (56 - idx) : (120 - idx);
diff --git a/native/common/jk_url.c b/native/common/jk_url.c
index 6e20593c1..6bb559435 100644
--- a/native/common/jk_url.c
+++ b/native/common/jk_url.c
@@ -24,7 +24,6 @@
 
 static void jk_c2hex(int ch, char *x)
 {
-#if !CHARSET_EBCDIC
     int i;
 
     x[0] = '%';
@@ -43,20 +42,6 @@ static void jk_c2hex(int ch, char *x)
     else {
         x[2] = '0' + i;
     }
-#else /*CHARSET_EBCDIC*/
-    static const char ntoa[] = { "0123456789ABCDEF" };
-    char buf[1];
-
-    ch &= 0xFF;
-
-    buf[0] = ch;
-    jk_xlate_to_ascii(buf, 1);
-
-    x[0] = '%';
-    x[1] = ntoa[(buf[0] >> 4) & 0x0F];
-    x[2] = ntoa[buf[0] & 0x0F];
-    x[3] = '\0';
-#endif /*CHARSET_EBCDIC*/
 }
 
 /*


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

Reply via email to