summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMartin Kraemer <martin@apache.org>2005-11-30 09:01:35 +0100
committerMartin Kraemer <martin@apache.org>2005-11-30 09:01:35 +0100
commit1d42526e3e1cc5da237a0ba961ac3c2c4391bf1c (patch)
tree1de20417f3d93d21c1ba22c7cb3bb5a894e701db /modules
parentRemove the problematic block which is causing problems with the latest versions (diff)
downloadapache2-1d42526e3e1cc5da237a0ba961ac3c2c4391bf1c.tar.xz
apache2-1d42526e3e1cc5da237a0ba961ac3c2c4391bf1c.zip
Fix SSL Protocol hexdumps for EBCDIC systems
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@349906 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/ssl/ssl_engine_io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c
index 0093e3b95e..3359e022f1 100644
--- a/modules/ssl/ssl_engine_io.c
+++ b/modules/ssl/ssl_engine_io.c
@@ -1722,6 +1722,16 @@ static void ssl_io_data_dump(server_rec *srvr,
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, srvr,
"+-------------------------------------------------------------------------+");
for(i = 0 ; i< rows; i++) {
+#if APR_CHARSET_EBCDIC
+ char ebcdic_text[DUMP_WIDTH];
+ j = DUMP_WIDTH;
+ if ((i * DUMP_WIDTH + j) > len)
+ j = len % DUMP_WIDTH;
+ if (j == 0)
+ j = DUMP_WIDTH;
+ memcpy(ebcdic_text,(char *)(s) + i * DUMP_WIDTH, j);
+ ap_xlate_proto_from_ascii(ebcdic_text, j);
+#endif /* APR_CHARSET_EBCDIC */
apr_snprintf(tmp, sizeof(tmp), "| %04x: ", i * DUMP_WIDTH);
apr_cpystrn(buf, tmp, sizeof(buf));
for (j = 0; j < DUMP_WIDTH; j++) {
@@ -1739,7 +1749,11 @@ static void ssl_io_data_dump(server_rec *srvr,
apr_cpystrn(buf+strlen(buf), " ", sizeof(buf)-strlen(buf));
else {
ch = ((unsigned char)*((char *)(s) + i * DUMP_WIDTH + j)) & 0xff;
+#if APR_CHARSET_EBCDIC
+ apr_snprintf(tmp, sizeof(tmp), "%c", (ch >= 0x20 && ch <= 0x7F) ? ebcdic_text[j] : '.');
+#else /* APR_CHARSET_EBCDIC */
apr_snprintf(tmp, sizeof(tmp), "%c", ((ch >= ' ') && (ch <= '~')) ? ch : '.');
+#endif /* APR_CHARSET_EBCDIC */
apr_cpystrn(buf+strlen(buf), tmp, sizeof(buf)-strlen(buf));
}
}