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/08/21 19:08:59 UTC

[tomcat] branch 9.0.x updated: Use MiB for 1024 * 1204 bytes and KiB for 1024 bytes

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

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new dbb75e2fc8 Use MiB for 1024 * 1204 bytes and KiB for 1024 bytes
dbb75e2fc8 is described below

commit dbb75e2fc83dfedc133162ef1dfe31b58dbbac0c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Aug 21 12:00:20 2023 -0700

    Use MiB for 1024 * 1204 bytes and KiB for 1024 bytes
---
 conf/web.xml                                       |  2 +-
 java/javax/servlet/http/Cookie.java                |  4 ++--
 java/org/apache/catalina/connector/Connector.java  |  4 ++--
 .../catalina/ha/deploy/FileMessageFactory.java     |  2 +-
 .../apache/catalina/manager/StatusTransformer.java |  8 ++++----
 .../apache/catalina/servlets/DefaultServlet.java   |  2 +-
 java/org/apache/catalina/ssi/SSIFsize.java         | 23 +++++++++++-----------
 .../group/interceptors/LocalStrings.properties     | 12 +++++------
 .../group/interceptors/LocalStrings_cs.properties  | 12 +++++------
 .../group/interceptors/LocalStrings_es.properties  | 10 +++++-----
 .../group/interceptors/LocalStrings_fr.properties  | 12 +++++------
 .../group/interceptors/LocalStrings_ja.properties  | 12 +++++------
 .../group/interceptors/LocalStrings_ko.properties  | 12 +++++------
 .../interceptors/LocalStrings_pt_BR.properties     | 12 +++++------
 .../interceptors/LocalStrings_zh_CN.properties     | 12 +++++------
 .../interceptors/MessageDispatchInterceptor.java   |  2 +-
 java/org/apache/catalina/tribes/io/BufferPool.java |  2 +-
 java/org/apache/catalina/util/IOTools.java         |  2 +-
 .../catalina/webresources/LocalStrings.properties  |  6 +++---
 .../webresources/LocalStrings_fr.properties        |  4 ++--
 .../webresources/LocalStrings_ja.properties        |  6 +++---
 .../webresources/LocalStrings_ko.properties        |  6 +++---
 .../webresources/LocalStrings_zh_CN.properties     |  6 +++---
 .../catalina/webresources/mbeans-descriptors.xml   |  6 +++---
 .../http/fileupload/disk/DiskFileItemFactory.java  |  2 +-
 .../catalina/core/TestSwallowAbortedUploads.java   |  2 +-
 .../catalina/tribes/demos/ChannelCreator.java      |  2 +-
 .../tribes/test/transport/SocketNioReceive.java    |  4 ++--
 .../tribes/test/transport/SocketNioSend.java       |  2 +-
 .../test/transport/SocketNioValidateSend.java      |  2 +-
 .../tribes/test/transport/SocketReceive.java       |  4 ++--
 .../tribes/test/transport/SocketTribesReceive.java |  4 ++--
 .../test/transport/SocketValidateReceive.java      |  4 ++--
 test/org/apache/tomcat/util/net/TestSsl.java       |  4 ++--
 webapps/docs/changelog.xml                         | 12 +++++++++++
 webapps/docs/config/ajp.xml                        |  6 +++---
 webapps/docs/config/cluster-interceptor.xml        |  2 +-
 webapps/docs/config/http.xml                       |  8 ++++----
 webapps/docs/config/resources.xml                  |  2 +-
 webapps/docs/config/systemprops.xml                |  2 +-
 webapps/docs/default-servlet.xml                   |  2 +-
 webapps/docs/security-howto.xml                    |  4 ++--
 webapps/docs/windows-service-howto.xml             |  6 +++---
 .../compressionFilters/CompressionFilter.java      |  2 +-
 .../CompressionServletResponseWrapper.java         |  2 +-
 webapps/manager/WEB-INF/web.xml                    |  2 +-
 46 files changed, 136 insertions(+), 123 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index 0b8b1edfe7..2c7874dcc0 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -73,7 +73,7 @@
   <!--                       contents. [null]                               -->
   <!--                                                                      -->
   <!--   sendfileSize        If the connector used supports sendfile, this  -->
-  <!--                       represents the minimal file size in KB for     -->
+  <!--                       represents the minimal file size in KiB for     -->
   <!--                       which sendfile will be used. Use a negative    -->
   <!--                       value to always disable sendfile.  [48]        -->
   <!--                                                                      -->
diff --git a/java/javax/servlet/http/Cookie.java b/java/javax/servlet/http/Cookie.java
index 0415a1b618..8652292748 100644
--- a/java/javax/servlet/http/Cookie.java
+++ b/java/javax/servlet/http/Cookie.java
@@ -34,8 +34,8 @@ import java.util.ResourceBundle;
  * sparingly to improve the interoperability of your servlets.
  * <p>
  * The servlet sends cookies to the browser by using the {@link HttpServletResponse#addCookie} method, which adds fields
- * to HTTP response headers to send cookies to the browser, one at a time. The browser is expected to support 20 cookies
- * for each Web server, 300 cookies total, and may limit cookie size to 4 KB each.
+ * to HTTP response headers to send cookies to the browser, one at a time. The browser is expected to support 50 cookies
+ * for each domain, 3000 cookies total, and may limit cookie size to 4 KiB each.
  * <p>
  * The browser returns cookies to the servlet by adding fields to HTTP request headers. Cookies can be retrieved from a
  * request by using the {@link HttpServletRequest#getCookies} method. Several cookies might have the same name but
diff --git a/java/org/apache/catalina/connector/Connector.java b/java/org/apache/catalina/connector/Connector.java
index fb77d9fb31..fad5e558ea 100644
--- a/java/org/apache/catalina/connector/Connector.java
+++ b/java/org/apache/catalina/connector/Connector.java
@@ -201,13 +201,13 @@ public class Connector extends LifecycleMBeanBase {
     protected int maxParameterCount = 10000;
 
     /**
-     * Maximum size of a POST which will be automatically parsed by the container. 2MB by default.
+     * Maximum size of a POST which will be automatically parsed by the container. 2MiB by default.
      */
     protected int maxPostSize = 2 * 1024 * 1024;
 
 
     /**
-     * Maximum size of a POST which will be saved by the container during authentication. 4kB by default
+     * Maximum size of a POST which will be saved by the container during authentication. 4KiB by default
      */
     protected int maxSavePostSize = 4 * 1024;
 
diff --git a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
index 18c32268e4..831aaa81bd 100644
--- a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
+++ b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
@@ -46,7 +46,7 @@ public class FileMessageFactory {
     /**
      * The number of bytes that we read from file
      */
-    public static final int READ_SIZE = 1024 * 10; // 10kb
+    public static final int READ_SIZE = 1024 * 10; // 10KiB
 
     /**
      * The file that we are reading/writing
diff --git a/java/org/apache/catalina/manager/StatusTransformer.java b/java/org/apache/catalina/manager/StatusTransformer.java
index 5fc4ac866b..2fa32b9abc 100644
--- a/java/org/apache/catalina/manager/StatusTransformer.java
+++ b/java/org/apache/catalina/manager/StatusTransformer.java
@@ -916,10 +916,10 @@ public class StatusTransformer {
 
 
     /**
-     * Display the given size in bytes, either as KB or MB.
+     * Display the given size in bytes, either as KiB or MiB.
      *
      * @param obj The object to format
-     * @param mb true to display megabytes, false for kilobytes
+     * @param mb true to display MiB, false for KiB
      * @return formatted size
      */
     public static String formatSize(Object obj, boolean mb) {
@@ -945,10 +945,10 @@ public class StatusTransformer {
             if (rest < 10) {
                 buff.append('0');
             }
-            buff.append(rest).append(" MB");
+            buff.append(rest).append(" MiB");
             return buff.toString();
         } else {
-            return ((bytes / 1024) + " KB");
+            return ((bytes / 1024) + " KiB");
         }
 
     }
diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java
index 891c68aeb4..3c33628b60 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2034,7 +2034,7 @@ public class DefaultServlet extends HttpServlet {
             rightSide = 1;
         }
 
-        return ("" + leftSide + "." + rightSide + " kb");
+        return ("" + leftSide + "." + rightSide + " KiB");
 
     }
 
diff --git a/java/org/apache/catalina/ssi/SSIFsize.java b/java/org/apache/catalina/ssi/SSIFsize.java
index 70cad8f124..59a2ba9bb3 100644
--- a/java/org/apache/catalina/ssi/SSIFsize.java
+++ b/java/org/apache/catalina/ssi/SSIFsize.java
@@ -32,8 +32,8 @@ import org.apache.tomcat.util.res.StringManager;
  */
 public final class SSIFsize implements SSICommand {
     private static final StringManager sm = StringManager.getManager(SSIFsize.class);
-    static final int ONE_KILOBYTE = 1024;
-    static final int ONE_MEGABYTE = 1024 * 1024;
+    static final int ONE_KIBIBYTE = 1024;
+    static final int ONE_MEBIBYTE = 1024 * 1024;
 
 
     /**
@@ -94,8 +94,9 @@ public final class SSIFsize implements SSICommand {
     }
 
 
-    //We try to mimic Apache here, as we do everywhere
-    //All the 'magic' numbers are from the util_script.c Apache source file.
+    // We try to mimic httpd here, as we do everywhere.
+    // All the 'magic' numbers are from the util_script.c httpd source file.
+    // Should use KiB and MiB in output but use k and M for consistency with httpd.
     protected String formatSize(long size, String format) {
         String retString = "";
         if (format.equalsIgnoreCase("bytes")) {
@@ -106,17 +107,17 @@ public final class SSIFsize implements SSICommand {
                 retString = "-";
             } else if (size == 0) {
                 retString = "0k";
-            } else if (size < ONE_KILOBYTE) {
+            } else if (size < ONE_KIBIBYTE) {
                 retString = "1k";
-            } else if (size < ONE_MEGABYTE) {
-                retString = Long.toString((size + 512) / ONE_KILOBYTE);
+            } else if (size < ONE_MEBIBYTE) {
+                retString = Long.toString((size + 512) / ONE_KIBIBYTE);
                 retString += "k";
-            } else if (size < 99 * ONE_MEGABYTE) {
+            } else if (size < 99 * ONE_MEBIBYTE) {
                 DecimalFormat decimalFormat = new DecimalFormat("0.0M");
-                retString = decimalFormat.format(size / (double)ONE_MEGABYTE);
+                retString = decimalFormat.format(size / (double)ONE_MEBIBYTE);
             } else {
-                retString = Long.toString((size + (529 * ONE_KILOBYTE))
-                        / ONE_MEGABYTE);
+                retString = Long.toString((size + (529 * ONE_KIBIBYTE))
+                        / ONE_MEBIBYTE);
                 retString += "M";
             }
             retString = padLeft(retString, 5);
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties
index 17c4a7e1c1..a2187e2520 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties
@@ -89,15 +89,15 @@ tcpPingInterceptor.pingFailed.pingThread=Unable to send ping from TCP ping threa
 
 throughputInterceptor.report=ThroughputInterceptor Report[\n\
 \tTx Msg:{0} messages\n\
-\tSent:{1} MB (total)\n\
-\tSent:{2} MB (application)\n\
+\tSent:{1} MiB (total)\n\
+\tSent:{2} MiB (application)\n\
 \tTime:{3} seconds\n\
-\tTx Speed:{4} MB/sec (total)\n\
-\tTx Speed:{5} MB/sec (application)\n\
+\tTx Speed:{4} MiB/sec (total)\n\
+\tTx Speed:{5} MiB/sec (application)\n\
 \tError Msg:{6}\n\
 \tRx Msg:{7} messages\n\
-\tRx Speed:{8} MB/sec (since 1st msg)\n\
-\tReceived:{9} MB]\n
+\tRx Speed:{8} MiB/sec (since 1st msg)\n\
+\tReceived:{9} MiB]\n
 
 twoPhaseCommitInterceptor.expiredMessage=Removing expired message [{0}]
 twoPhaseCommitInterceptor.heartbeat.failed=Unable to perform heartbeat on the TwoPhaseCommit interceptor.
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_cs.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_cs.properties
index 7987d186ed..efa7d63d08 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_cs.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_cs.properties
@@ -46,14 +46,14 @@ tcpPingInterceptor.ping.failed=Nelze poslat TCP ping.
 
 throughputInterceptor.report=ThroughputInterceptor Výpis[\n\
 \tOdchozí zprávy:{0} zpráv\n\
-\tOdesláno:{1} MB (celkem)\n\
-\tOdesláno:{2} MB (aplikace)\n\
+\tOdesláno:{1} MiB (celkem)\n\
+\tOdesláno:{2} MiB (aplikace)\n\
 \tČas:{3} sekund\n\
-\tOdchozí rychlost:{4} MB/sec (celkem)\n\
-\tOdchozí rychlost:{5} MB/sec (aplikace)\n\
+\tOdchozí rychlost:{4} MiB/sec (celkem)\n\
+\tOdchozí rychlost:{5} MiB/sec (aplikace)\n\
 \tChybové zprávy:{6}\n\
 \tPříchozí zprávy:{7} zpráv\n\
-\tPříchozí rychlost:{8} MB/sec (od první zprávy)\n\
-\tPřijato:{9} MB]
+\tPříchozí rychlost:{8} MiB/sec (od první zprávy)\n\
+\tPřijato:{9} MiB]
 
 twoPhaseCommitInterceptor.heartbeat.failed=Nelze provést heartbeat na TwoPhaseCommit interceptoru.
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_es.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_es.properties
index 7453ad7a4d..b54950f929 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_es.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_es.properties
@@ -49,13 +49,13 @@ tcpPingInterceptor.ping.failed=Imposible enviar ping TCP
 
 throughputInterceptor.report=ThroughputInterceptor Reporte[\n\
 \tTx Msg:{0} mensajes\n\
-\tEnviados:{2} MB (aplicación)\n\
+\tEnviados:{2} MiB (aplicación)\n\
 \tTiempo:{3} segundos\n\
-\tTx Speed:{4} MB/seg(total)\n\
-\tTx Speed::{5} MB/seg(aplicación)\n\
+\tTx Speed:{4} MiB/seg(total)\n\
+\tTx Speed::{5} MiB/seg(aplicación)\n\
 \tMsg error:{6}\n\
 \tRx Msg:{7} mensajes\n\
-\tRx Speed:{8} MB/sec (desde 1er msg)\n\
-\tRecivido:{9} MB]
+\tRx Speed:{8} MiB/sec (desde 1er msg)\n\
+\tRecivido:{9} MiB]
 
 twoPhaseCommitInterceptor.heartbeat.failed=Incapáz de ejecutar heartbeat en el interceptor TwoPhaseCommit
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_fr.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_fr.properties
index 707fa9ba36..994f01abd1 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_fr.properties
@@ -89,15 +89,15 @@ tcpPingInterceptor.pingFailed.pingThread=Impossible d'envoyer un ping à partir
 
 throughputInterceptor.report=Rapport de l''intercepteur du débit ("ThroughputInterceptor Report") [\n\
 \tMsg Transmis (Tx Msg) : {0} messages\n\
-\tEnvoyé (Sent) : {1} MB (total)\n\
-\tEnvoyé (Sent) : {2} MB (application)\n\
+\tEnvoyé (Sent) : {1} MiB (total)\n\
+\tEnvoyé (Sent) : {2} MiB (application)\n\
 \tDurée (Time) : {3} secondes\n\
-\tVitesse d''écriture (Tx Speed) : {4} MB/sec (total)\n\
-\tVitesse d''écriture (Tx Speed) : {5} MB/sec (application)\n\
+\tVitesse d''écriture (Tx Speed) : {4} MiB/sec (total)\n\
+\tVitesse d''écriture (Tx Speed) : {5} MiB/sec (application)\n\
 \tMsg d''erreur (Error Msg) : {6}\n\
 \tMsg Reçus (Rx Msg) : {7} messages\n\
-\tVitesse de Réception (Rx Speed) : {8} MB/sec (depuis le 1er message)\n\
-\tReçu : {9} MB]
+\tVitesse de Réception (Rx Speed) : {8} MiB/sec (depuis le 1er message)\n\
+\tReçu : {9} MiB]
 
 twoPhaseCommitInterceptor.expiredMessage=Retrait du message expiré [{0}]
 twoPhaseCommitInterceptor.heartbeat.failed=Impossible d'exécuter un battement de coeur (heartbeat) sur l'intercepteur (interceptor) "TwoPhaseCommit".
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ja.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ja.properties
index 1618d81798..4abf3bdd33 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ja.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ja.properties
@@ -89,15 +89,15 @@ tcpPingInterceptor.pingFailed.pingThread=TCP pingスレッドからpingを送信
 
 throughputInterceptor.report=ThroughputInterceptor Report[\n\
 \        送信メッセージ (Tx Msg):{0} messages\n\
-\        送信済み (Sent):{1} MB (total)\n\
-\        送信済み (Sent):{2} MB (application)\n\
+\        送信済み (Sent):{1} MiB (total)\n\
+\        送信済み (Sent):{2} MiB (application)\n\
 \        時間 (Time):{3} seconds\n\
-\        送信速度 (Tx Speed):{4} MB/sec (total)\n\
-\        送信速度 (Tx Speed):{5} MB/sec (application)\n\
+\        送信速度 (Tx Speed):{4} MiB/sec (total)\n\
+\        送信速度 (Tx Speed):{5} MiB/sec (application)\n\
 \        エラーメッセージ (Error Msg):{6}\n\
 \        受信メッセージ (Rx Msg):{7} messages\n\
-\        受信速度 (Rx Speed):{8} MB/sec (since 1st msg)\n\
-\        受信済み (Received):{9} MB]
+\        受信速度 (Rx Speed):{8} MiB/sec (since 1st msg)\n\
+\        受信済み (Received):{9} MiB]
 
 twoPhaseCommitInterceptor.expiredMessage=期限切れのメッセージを取り除きました。 [{0}]
 twoPhaseCommitInterceptor.heartbeat.failed=TwoPhaseCommit インターセプターのハートビートが失敗しました。
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ko.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ko.properties
index bc1a7fde84..4f3a547da2 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ko.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ko.properties
@@ -89,15 +89,15 @@ tcpPingInterceptor.pingFailed.pingThread=TCP ping 쓰레드로부터, ping을 
 
 throughputInterceptor.report=ThroughputInterceptor의 보고 [\n\
 \tTx Msg:{0} 메시지(들)\n\
-\tSent:{1} MB (전체)\n\
-\tSent:{2} MB (애플리케이션)\n\
+\tSent:{1} MiB (전체)\n\
+\tSent:{2} MiB (애플리케이션)\n\
 \tTime:{3} 초\n\
-\tTx Speed:{4} MB/sec (전체)\n\
-\tTx Speed:{5} MB/sec (애플리케이션)\n\
+\tTx Speed:{4} MiB/sec (전체)\n\
+\tTx Speed:{5} MiB/sec (애플리케이션)\n\
 \tError Msg:{6}\n\
 \tRx Msg:{7} 메시지\n\
-\tRx Speed:{8} MB/sec (첫번째 메시지 이후로)\n\
-\tReceived:{9} MB]\n\
+\tRx Speed:{8} MiB/sec (첫번째 메시지 이후로)\n\
+\tReceived:{9} MiB]\n\
 \n
 
 twoPhaseCommitInterceptor.expiredMessage=만료된 메시지 [{0}]을(를) 제거합니다.
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_pt_BR.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_pt_BR.properties
index f145232f82..ec8a0d39ff 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_pt_BR.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_pt_BR.properties
@@ -27,12 +27,12 @@ tcpPingInterceptor.ping.failed=Imposível enviar ping TCP
 
 throughputInterceptor.report=ThroughputInterceptor Report[\n\
 \tMsg Tx:{0} mensagens\n\
-\tEnviado:{1} MB (total)\n\
-\tEnviado:{2} MB (aplicação)\n\
+\tEnviado:{1} MiB (total)\n\
+\tEnviado:{2} MiB (aplicação)\n\
 \tTempo:{3} segundos\n\
-\tTaxa Tx:{4} MB/seg (total)\n\
-\tTaxa Tx:{5} MB/seg (aplicação)\n\
+\tTaxa Tx:{4} MiB/seg (total)\n\
+\tTaxa Tx:{5} MiB/seg (aplicação)\n\
 \tMsgs erro:{6}\n\
 \tRx Msg:{7} mensagens\n\
-\tTaxa Rx:{8} MB/seg (desde a primeira mensagem)\n\
-\tRecebido:{9} MB]
+\tTaxa Rx:{8} MiB/seg (desde a primeira mensagem)\n\
+\tRecebido:{9} MiB]
diff --git a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_zh_CN.properties b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_zh_CN.properties
index 78e2cc7d89..ba80e510ca 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/tribes/group/interceptors/LocalStrings_zh_CN.properties
@@ -89,15 +89,15 @@ tcpPingInterceptor.pingFailed.pingThread=不能从ping 线程发送ping
 
 throughputInterceptor.report=吞吐量拦截器报告[\n\
 \    传输消息: {0}消息数\n\
-\    发送:{1}MB(总共)\n\
-\    发送:{2}MB (应用)\n\
+\    发送:{1}MiB (总共)\n\
+\    发送:{2}MiB (应用)\n\
 \    耗时:{3}秒\n\
-\    传输速率:{4}MB/秒(总共)\n\
-\    传输速率:{5}MB/秒(应用)\n\
+\    传输速率:{4}MiB/秒(总共)\n\
+\    传输速率:{5}MiB/秒(应用)\n\
 \    错误消息:{6}\n\
 \    接收消息:{7} 消息数\n\
-\    接收速率:{8} MB/秒(从第一个消息开始)\n\
-\    收到:{9}MB]\n
+\    接收速率:{8} MiB/秒(从第一个消息开始)\n\
+\    收到:{9}MiB]\n
 
 twoPhaseCommitInterceptor.expiredMessage=正在删除过期邮件[{0}]
 twoPhaseCommitInterceptor.heartbeat.failed=无法在两阶段提交拦截器上执行心跳。
diff --git a/java/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java b/java/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java
index 33113f62b0..567ef5b8b1 100644
--- a/java/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java
+++ b/java/org/apache/catalina/tribes/group/interceptors/MessageDispatchInterceptor.java
@@ -48,7 +48,7 @@ public class MessageDispatchInterceptor extends ChannelInterceptorBase
     protected static final StringManager sm =
             StringManager.getManager(MessageDispatchInterceptor.class);
 
-    protected long maxQueueSize = 1024*1024*64; //64MB
+    protected long maxQueueSize = 1024*1024*64; //64MiB
     protected volatile boolean run = false;
     protected boolean useDeepClone = true;
     protected boolean alwaysSend = true;
diff --git a/java/org/apache/catalina/tribes/io/BufferPool.java b/java/org/apache/catalina/tribes/io/BufferPool.java
index 11f7752216..49c5b8dca5 100644
--- a/java/org/apache/catalina/tribes/io/BufferPool.java
+++ b/java/org/apache/catalina/tribes/io/BufferPool.java
@@ -24,7 +24,7 @@ import org.apache.juli.logging.LogFactory;
 public class BufferPool {
     private static final Log log = LogFactory.getLog(BufferPool.class);
 
-    public static final int DEFAULT_POOL_SIZE = 100*1024*1024; //100MB
+    public static final int DEFAULT_POOL_SIZE = 100*1024*1024; //100MiB
 
     protected static final StringManager sm = StringManager.getManager(BufferPool.class);
 
diff --git a/java/org/apache/catalina/util/IOTools.java b/java/org/apache/catalina/util/IOTools.java
index 22ba06f3d5..5afbd4ceff 100644
--- a/java/org/apache/catalina/util/IOTools.java
+++ b/java/org/apache/catalina/util/IOTools.java
@@ -71,7 +71,7 @@ public class IOTools {
     /**
      * Read input from input stream and write it to output stream until there is
      * no more input from input stream using a new buffer of the default size
-     * (4kB).
+     * (4KiB).
      *
      * @param is input stream the input stream to read from.
      * @param os output stream the output stream to write to.
diff --git a/java/org/apache/catalina/webresources/LocalStrings.properties b/java/org/apache/catalina/webresources/LocalStrings.properties
index aa83c3fe4f..772d2b88f9 100644
--- a/java/org/apache/catalina/webresources/LocalStrings.properties
+++ b/java/org/apache/catalina/webresources/LocalStrings.properties
@@ -23,9 +23,9 @@ abstractResource.getContentTooLarge=Unable to return [{0}] as a byte array since
 abstractResourceSet.checkPath=The requested path [{0}] is not valid. It must begin with "/".
 
 cache.addFail=Unable to add the resource at [{0}] to the cache for web application [{1}] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
-cache.backgroundEvictFail=The background cache eviction process was unable to free [{0}] percent of the cache for Context [{1}] - consider increasing the maximum size of the cache. After eviction approximately [{2}] KB of data remained in the cache.
-cache.objectMaxSizeTooBig=The value of [{0}]kB for objectMaxSize is larger than the limit of maxSize/20 so has been reduced to [{1}]kB
-cache.objectMaxSizeTooBigBytes=The value specified for the maximum object size to cache [{0}]kB is greater than Integer.MAX_VALUE bytes which is the maximum size that can be cached. The limit will be set to Integer.MAX_VALUE bytes.
+cache.backgroundEvictFail=The background cache eviction process was unable to free [{0}] percent of the cache for Context [{1}] - consider increasing the maximum size of the cache. After eviction approximately [{2}] KiB of data remained in the cache.
+cache.objectMaxSizeTooBig=The value of [{0}]KiB for objectMaxSize is larger than the limit of maxSize/20 so has been reduced to [{1}]KiB
+cache.objectMaxSizeTooBigBytes=The value specified for the maximum object size to cache [{0}]KiB is greater than Integer.MAX_VALUE bytes which is the maximum size that can be cached. The limit will be set to Integer.MAX_VALUE bytes.
 
 cachedResource.invalidURL=Unable to create an instance of CachedResourceURLStreamHandler because the URL [{0}] is malformed
 
diff --git a/java/org/apache/catalina/webresources/LocalStrings_fr.properties b/java/org/apache/catalina/webresources/LocalStrings_fr.properties
index 3b2a5196e5..5bfbf995ce 100644
--- a/java/org/apache/catalina/webresources/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/webresources/LocalStrings_fr.properties
@@ -24,8 +24,8 @@ abstractResourceSet.checkPath=Le chemin demandé [{0}] n''est pas valide, il doi
 
 cache.addFail=Incapable d''ajouter la ressource située [{0}] au cache de l''application web [{1}] parce qu''il n''y avait pas assez d''espace libre disponible après l''éviction des entrées de cache expirées - envisagez d''augmenter la taille maximale du cache
 cache.backgroundEvictFail=Le processus d''arrière plan d''éviction du cache n''a pas pu nettoyer [{0}] pourcents du cache pour le contexte [{1}], il faudrait augmenter la taille maximale du cache ; après l''éviction, approximativement [{2}] KO de données restaient dans le cache
-cache.objectMaxSizeTooBig=La valeur [{0}]kB pour l''objectMaxSize est plus grade que la limite de maxSize/20 son elle a été réduite à [{1}]kB\n
-cache.objectMaxSizeTooBigBytes=La valeur de taille d''objet maximale pouvant être mis en cache de [{0}]kB est supérieure à Integer.MAX_VALUE qui est le maximum, la limite a donc été fixée à Integer.MAX_VALUE octets
+cache.objectMaxSizeTooBig=La valeur [{0}]KiB pour l''objectMaxSize est plus grade que la limite de maxSize/20 son elle a été réduite à [{1}]KiB\n
+cache.objectMaxSizeTooBigBytes=La valeur de taille d''objet maximale pouvant être mis en cache de [{0}]KiB est supérieure à Integer.MAX_VALUE qui est le maximum, la limite a donc été fixée à Integer.MAX_VALUE octets
 
 cachedResource.invalidURL=La création d''une instance de CachedResourceURLStreamHandler a échouée car l''URL [{0}] est malformée
 
diff --git a/java/org/apache/catalina/webresources/LocalStrings_ja.properties b/java/org/apache/catalina/webresources/LocalStrings_ja.properties
index 6b41650536..5b4c6ad9d1 100644
--- a/java/org/apache/catalina/webresources/LocalStrings_ja.properties
+++ b/java/org/apache/catalina/webresources/LocalStrings_ja.properties
@@ -23,9 +23,9 @@ abstractResource.getContentTooLarge=リソースがバイト配列の最大サ
 abstractResourceSet.checkPath=リクエストパス [{0}] が無効です。"/"で始まる必要があります。
 
 cache.addFail=有効期限切れの項目を破棄しても利用可能な領域が不足するため、Web アプリケーション [{1}] のキャッシュにリソース [{0}] を追加できません。最大キャッシュサイズの増加を検討してください。
-cache.backgroundEvictFail=コンテキスト [{1}] のバックグラウンドキャッシュ削除処理は全体の [{0}] % を解放できませんでした。キャッシュサイズの最大値の増加を検討してください。現在は約 [{2}] kB のデータがキャッシュに残存しています。
-cache.objectMaxSizeTooBig=objectMaxSizeの [{0}] kBの値がmaxSize / 20の制限より大きいため、[{1}] kBに減少しました
-cache.objectMaxSizeTooBigBytes=キャッシュ可能なオブジェクトサイズの最大値に指定された [{0}]kB は Integer.MAX_VALUE バイトを越えています。最大値に Integer.MAX_VALUE を設定します。
+cache.backgroundEvictFail=コンテキスト [{1}] のバックグラウンドキャッシュ削除処理は全体の [{0}] % を解放できませんでした。キャッシュサイズの最大値の増加を検討してください。現在は約 [{2}] KiB のデータがキャッシュに残存しています。
+cache.objectMaxSizeTooBig=objectMaxSizeの [{0}] KiBの値がmaxSize / 20の制限より大きいため、[{1}] KiBに減少しました
+cache.objectMaxSizeTooBigBytes=キャッシュ可能なオブジェクトサイズの最大値に指定された [{0}]KiB は Integer.MAX_VALUE バイトを越えています。最大値に Integer.MAX_VALUE を設定します。
 
 cachedResource.invalidURL=URL [{0}] は不正です。CachedResourceURLStreamHandler インスタンスを生成できません
 
diff --git a/java/org/apache/catalina/webresources/LocalStrings_ko.properties b/java/org/apache/catalina/webresources/LocalStrings_ko.properties
index dea053d75d..21928777a9 100644
--- a/java/org/apache/catalina/webresources/LocalStrings_ko.properties
+++ b/java/org/apache/catalina/webresources/LocalStrings_ko.properties
@@ -23,9 +23,9 @@ abstractResource.getContentTooLarge=리소스의 크기가 [{1}] 바이트로서
 abstractResourceSet.checkPath=요청된 경로 [{0}]은(는) 유효하지 않습니다. 반드시 "/"로 시작해야 합니다.
 
 cache.addFail=[{0}]에 위치한 리소스를 웹 애플리케이션 [{1}]을(를) 위한 캐시에 추가할 수 없습니다. 왜냐하면 만료된 캐시 엔트리들을 없애버린 이후에도 여유 공간이 충분하지 않기 때문입니다. 캐시의 최대 크기를 증가시키는 것을 고려해 보십시오.
-cache.backgroundEvictFail=백그라운드 캐시 퇴거 (cache eviction) 프로세스가, 컨텍스트 [{1}]을(를) 위한 캐시의 [{0}] 퍼센트를 해제시킬 수 없었습니다. 캐시의 최대 크기를 증가시킬 것을 고려해 보십시오. 캐시 퇴거 작업 이후, 대략 [{2}] KB의 데이터가 캐시에 남아 있습니다.
-cache.objectMaxSizeTooBig=objectMaxSize를 위한 값 [{0}]kB이, maxSize/20인 최대한계값 보다 커서, [{1}]kB로 줄여졌습니다.
-cache.objectMaxSizeTooBigBytes=[{0}]kB를 캐시하기 위해, 최대 객체 크기로서 지정된 값이 Integer.MAX_VALUE 바이트보다 큰데, Integer.MAX_VALUE는 캐시될 수 있는 최대 크기입니다. 한계 값을 Integer.MAX_VALUE 바이트로 설정하겠습니다.
+cache.backgroundEvictFail=백그라운드 캐시 퇴거 (cache eviction) 프로세스가, 컨텍스트 [{1}]을(를) 위한 캐시의 [{0}] 퍼센트를 해제시킬 수 없었습니다. 캐시의 최대 크기를 증가시킬 것을 고려해 보십시오. 캐시 퇴거 작업 이후, 대략 [{2}] KiB의 데이터가 캐시에 남아 있습니다.
+cache.objectMaxSizeTooBig=objectMaxSize를 위한 값 [{0}]KiB이, maxSize/20인 최대한계값 보다 커서, [{1}]KiB로 줄여졌습니다.
+cache.objectMaxSizeTooBigBytes=[{0}]KiB를 캐시하기 위해, 최대 객체 크기로서 지정된 값이 Integer.MAX_VALUE 바이트보다 큰데, Integer.MAX_VALUE는 캐시될 수 있는 최대 크기입니다. 한계 값을 Integer.MAX_VALUE 바이트로 설정하겠습니다.
 
 cachedResource.invalidURL=URL [{0}]이(가) 유효하지 않기 때문에 CachedResourceURLStreamHandler 인스턴스를 생성할 수 없습니다.
 
diff --git a/java/org/apache/catalina/webresources/LocalStrings_zh_CN.properties b/java/org/apache/catalina/webresources/LocalStrings_zh_CN.properties
index 1d3b8d9f7b..6ba14b3f62 100644
--- a/java/org/apache/catalina/webresources/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/webresources/LocalStrings_zh_CN.properties
@@ -23,9 +23,9 @@ abstractResource.getContentTooLarge=无法返回[{0}]作为字节数组,因为
 abstractResourceSet.checkPath=请求的路径[{0}]无效。必须以“/”开头。
 
 cache.addFail=无法将位于[{0}]的资源添加到Web应用程序[{1}]的缓存中,因为在清除过期缓存条目后可用空间仍不足 - 请考虑增加缓存的最大空间。
-cache.backgroundEvictFail=后台缓存收回进程无法释放上下文[{1}]的缓存的[{0}]%-请考虑增加缓存的最大大小。在逐出之后,缓存中大约保留了[{2}]KB的数据。
-cache.objectMaxSizeTooBig=objectMaxSize的值[{0}]kB大于maxSize/20的限制,因此已缩减为[{1}]kB
-cache.objectMaxSizeTooBigBytes=为要缓存的最大对象大小[{0}] kB指定的值大于Integer.MAX_VALUE字节,后者是可以缓存的最大大小。该限制将设置为Integer.MAX_VALUE字节。
+cache.backgroundEvictFail=后台缓存收回进程无法释放上下文[{1}]的缓存的[{0}]%-请考虑增加缓存的最大大小。在逐出之后,缓存中大约保留了[{2}]KiB的数据。
+cache.objectMaxSizeTooBig=objectMaxSize的值[{0}]KiB大于maxSize/20的限制,因此已缩减为[{1}]KiB
+cache.objectMaxSizeTooBigBytes=为要缓存的最大对象大小[{0}] KiB指定的值大于Integer.MAX_VALUE字节,后者是可以缓存的最大大小。该限制将设置为Integer.MAX_VALUE字节。
 
 cachedResource.invalidURL=无法创建CachedResourceURLStreamHandler实例,因为URL[{0}]畸形
 
diff --git a/java/org/apache/catalina/webresources/mbeans-descriptors.xml b/java/org/apache/catalina/webresources/mbeans-descriptors.xml
index 057572884e..d38104e62a 100644
--- a/java/org/apache/catalina/webresources/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/webresources/mbeans-descriptors.xml
@@ -76,17 +76,17 @@
             writeable="false"/>
 
     <attribute   name="maxSize"
-          description="The maximum permitted size of the cache in kB"
+          description="The maximum permitted size of the cache in KiB"
                  type="long"
             writeable="true"/>
 
     <attribute   name="objectMaxSize"
-          description="The maximum permitted size for a single object in the cache in kB"
+          description="The maximum permitted size for a single object in the cache in KiB"
                  type="int"
             writeable="true"/>
 
     <attribute   name="size"
-          description="The current estimate of the cache size in kB"
+          description="The current estimate of the cache size in KiB"
                  type="long"
             writeable="false"/>
 
diff --git a/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java b/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
index f19c5c3af6..129c51bfae 100644
--- a/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
+++ b/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
@@ -34,7 +34,7 @@ import org.apache.tomcat.util.http.fileupload.FileItemFactory;
  * <p>If not otherwise configured, the default configuration values are as
  * follows:</p>
  * <ul>
- *   <li>Size threshold is 10KB.</li>
+ *   <li>Size threshold is 10KiB.</li>
  *   <li>Repository is the system default temp directory, as returned by
  *       {@code System.getProperty("java.io.tmpdir")}.</li>
  * </ul>
diff --git a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
index 26946457da..d2ecc33d9d 100644
--- a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
+++ b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
@@ -454,7 +454,7 @@ public class TestSwallowAbortedUploads extends TomcatBaseTest {
             // Smarter than the typical client. Attempts to read the response
             // even if the request is not fully written.
             try {
-                // Write (or try to write) 16MB
+                // Write (or try to write) 16MiB
                 for (int i = 0; i < 1024 * 1024; i++) {
                     writer.write("10\r\n");
                     writer.write("0123456789ABCDEF\r\n");
diff --git a/test/org/apache/catalina/tribes/demos/ChannelCreator.java b/test/org/apache/catalina/tribes/demos/ChannelCreator.java
index 3097e22023..3d2753e96d 100644
--- a/test/org/apache/catalina/tribes/demos/ChannelCreator.java
+++ b/test/org/apache/catalina/tribes/demos/ChannelCreator.java
@@ -81,7 +81,7 @@ public class ChannelCreator {
         String transport = "org.apache.catalina.tribes.transport.nio.PooledParallelSender";
         String receiver = "org.apache.catalina.tribes.transport.nio.NioReceiver";
         boolean async = false;
-        int asyncsize = 1024 * 1024 * 50; // 50MB
+        int asyncsize = 1024 * 1024 * 50; // 50MiB
         boolean throughput = false;
         boolean failuredetect = false;
 
diff --git a/test/org/apache/catalina/tribes/test/transport/SocketNioReceive.java b/test/org/apache/catalina/tribes/test/transport/SocketNioReceive.java
index 9936c6360e..32122ea8d6 100644
--- a/test/org/apache/catalina/tribes/test/transport/SocketNioReceive.java
+++ b/test/org/apache/catalina/tribes/test/transport/SocketNioReceive.java
@@ -57,7 +57,7 @@ public class SocketNioReceive {
             try {
                 Thread.sleep(5000);
                 if ( start != 0 ) {
-                    System.out.println("Throughput " + df.format(mb / seconds) + " MB/seconds, messages "+count+" accepts "+accept+", total "+mb+" MB.");
+                    System.out.println("Throughput " + df.format(mb / seconds) + " MiBseconds, messages "+count+" accepts "+accept+", total "+mb+" MiB");
                 }
             }catch (Throwable x) {
                 x.printStackTrace();
@@ -82,7 +82,7 @@ public class SocketNioReceive {
             if ( ( (count) % 10000) == 0) {
                 long time = System.currentTimeMillis();
                 seconds = ( (double) (time - start)) / 1000;
-                System.out.println("Throughput " + df.format(mb / seconds) + " MB/seconds, messages "+count+", total "+mb+" MB.");
+                System.out.println("Throughput " + df.format(mb / seconds) + " MiBseconds, messages "+count+", total "+mb+" MiB");
             }
         }
 
diff --git a/test/org/apache/catalina/tribes/test/transport/SocketNioSend.java b/test/org/apache/catalina/tribes/test/transport/SocketNioSend.java
index e865dd7412..567e2f9965 100644
--- a/test/org/apache/catalina/tribes/test/transport/SocketNioSend.java
+++ b/test/org/apache/catalina/tribes/test/transport/SocketNioSend.java
@@ -89,7 +89,7 @@ public class SocketNioSend {
                         if ( ( (++count) % 10000) == 0) {
                             long time = System.currentTimeMillis();
                             double seconds = ( (double) (time - start)) / 1000;
-                            System.out.println("Throughput " + df.format(mb / seconds) + " MB/seconds, total "+mb+" MB, total "+total+" bytes.");
+                            System.out.println("Throughput " + df.format(mb / seconds) + " MiBseconds, total "+mb+" MiB total "+total+" bytes.");
                         }
                     }
 
diff --git a/test/org/apache/catalina/tribes/test/transport/SocketNioValidateSend.java b/test/org/apache/catalina/tribes/test/transport/SocketNioValidateSend.java
index 0a95826389..49f4964b5e 100644
--- a/test/org/apache/catalina/tribes/test/transport/SocketNioValidateSend.java
+++ b/test/org/apache/catalina/tribes/test/transport/SocketNioValidateSend.java
@@ -86,7 +86,7 @@ public class SocketNioValidateSend {
                         if ( ( (++count) % 10000) == 0) {
                             long time = System.currentTimeMillis();
                             double seconds = ( (double) (time - start)) / 1000;
-                            System.out.println("Throughput " + df.format(mb / seconds) + " MB/seconds, total "+mb+" MB, total "+total+" bytes.");
+                            System.out.println("Throughput " + df.format(mb / seconds) + " MiBseconds, total "+mb+" MiB total "+total+" bytes.");
                         }
                     }
 
diff --git a/test/org/apache/catalina/tribes/test/transport/SocketReceive.java b/test/org/apache/catalina/tribes/test/transport/SocketReceive.java
index 2cfac6d6ea..0faa8786e7 100644
--- a/test/org/apache/catalina/tribes/test/transport/SocketReceive.java
+++ b/test/org/apache/catalina/tribes/test/transport/SocketReceive.java
@@ -84,7 +84,7 @@ public class SocketReceive {
         long time = System.currentTimeMillis();
         double seconds = ((double)(time-start))/1000;
         System.out.println("Throughput " + df.format(mb/seconds) +
-                " MB/seconds messages " + count + ", total " + mb +
-                " MB, total " + total + " bytes.");
+                " MiBseconds messages " + count + ", total " + mb +
+                " MiB total " + total + " bytes.");
     }
 }
\ No newline at end of file
diff --git a/test/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java b/test/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java
index 9300100656..8314bd174f 100644
--- a/test/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java
+++ b/test/org/apache/catalina/tribes/test/transport/SocketTribesReceive.java
@@ -97,7 +97,7 @@ public class SocketTribesReceive {
         long time = System.currentTimeMillis();
         double seconds = ((double)(time-start))/1000;
         System.out.println("Throughput " + df.format(mb/seconds) +
-                " MB/seconds messages " + count + ", total " + mb +
-                " MB, total " + total + " bytes.");
+                " MiBseconds messages " + count + ", total " + mb +
+                " MiB total " + total + " bytes.");
     }
 }
\ No newline at end of file
diff --git a/test/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java b/test/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java
index 0b742126c5..e6b9aeeadf 100644
--- a/test/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java
+++ b/test/org/apache/catalina/tribes/test/transport/SocketValidateReceive.java
@@ -89,8 +89,8 @@ public class SocketValidateReceive {
         long time = System.currentTimeMillis();
         double seconds = ((double)(time-start))/1000;
         System.out.println("Throughput " + df.format(mb/seconds) +
-                " MB/seconds messages " + count + ", total " + mb +
-                " MB, total " + total + " bytes.");
+                " MiBseconds messages " + count + ", total " + mb +
+                " MiB total " + total + " bytes.");
     }
 
     public static class MyDataReader {
diff --git a/test/org/apache/tomcat/util/net/TestSsl.java b/test/org/apache/tomcat/util/net/TestSsl.java
index 1ca594b33f..9a7b92ed28 100644
--- a/test/org/apache/tomcat/util/net/TestSsl.java
+++ b/test/org/apache/tomcat/util/net/TestSsl.java
@@ -81,7 +81,7 @@ public class TestSsl extends TomcatBaseTest {
     private static final int POST_DATA_SIZE = 16 * 1024 * 1024;
     private static final byte[] POST_DATA;
     static {
-        POST_DATA = new byte[POST_DATA_SIZE]; // 16MB
+        POST_DATA = new byte[POST_DATA_SIZE]; // 16MiB
         Arrays.fill(POST_DATA, (byte) 1);
 
     }
@@ -115,7 +115,7 @@ public class TestSsl extends TomcatBaseTest {
                         os.write("POST /post HTTP/1.1\r\n".getBytes());
                         os.write("Host: localhost\r\n".getBytes());
                         os.write(("Content-Length: " + Integer.valueOf(POST_DATA.length) + "\r\n\r\n").getBytes());
-                        // Write in 128KB blocks
+                        // Write in 128KiB blocks
                         for (int i = 0; i < POST_DATA.length / (128 * 1024); i++) {
                             os.write(POST_DATA, 0, 1024 * 128);
                             Thread.sleep(10);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4563b05c59..94948bae1b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,18 @@
         provided error code during error page processing rather than assuming an
         error code of 500. (markt)
       </fix>
+      <fix>
+        Update code comments and Tomcat output to use MiB for 1024 * 1024 bytes
+        and KiB for 1024 bytes rather than MB and kB. (martk)
+      </fix>
+    </changelog>
+  </subsection>
+  <subsection name="Web applications">
+    <changelog>
+      <fix>
+        Documentation. Update documentation to use MiB for 1024 * 1024 bytes and
+        KiB for 1024 bytes rather than MB and kB. (martk)
+      </fix>
     </changelog>
   </subsection>
 </section>
diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml
index 034c4904a5..111d275495 100644
--- a/webapps/docs/config/ajp.xml
+++ b/webapps/docs/config/ajp.xml
@@ -151,7 +151,7 @@
       <p>The maximum size in bytes of the POST which will be handled by
       the container FORM URL parameter parsing. The limit can be disabled by
       setting this attribute to a value less than zero. If not specified, this
-      attribute is set to 2097152 (2 megabytes). Note that the
+      attribute is set to 2097152 (2 MiB). Note that the
       <a href="filter.html#Failed_Request_Filter"><code>FailedRequestFilter</code></a>
       can be used to reject requests that exceed this limit.</p>
     </attribute>
@@ -168,7 +168,7 @@
       authentication request expires. The limit can be disabled by setting this
       attribute to -1. Setting the attribute to zero will disable the saving of
       POST data during authentication. If not specified, this attribute is set
-      to 4096 (4 kilobytes).</p>
+      to 4096 (4 KiB).</p>
     </attribute>
 
     <attribute name="parseBodyMethods" required="false">
@@ -715,7 +715,7 @@
         application write buffer size + network read buffer size +
         network write buffer size</code><br/>
         The value is in bytes, the default value is <code>1024*1024*100</code>
-        (100MB).</p>
+        (100MiB).</p>
       </attribute>
 
       <attribute name="socket.processorCache" required="false">
diff --git a/webapps/docs/config/cluster-interceptor.xml b/webapps/docs/config/cluster-interceptor.xml
index 1adfcf3336..ff2fa3fa45 100644
--- a/webapps/docs/config/cluster-interceptor.xml
+++ b/webapps/docs/config/cluster-interceptor.xml
@@ -132,7 +132,7 @@
        is sent synchronously, if <code>false</code> an error is thrown.
      </attribute>
      <attribute name="maxQueueSize" required="false">
-       Size in bytes of the dispatch queue, the default value is <code> 1024*1024*64 (64MB)</code> sets the maximum queue size for the dispatch queue
+       Size in bytes of the dispatch queue, the default value is <code> 1024*1024*64 (64MiB)</code> sets the maximum queue size for the dispatch queue
        if the queue fills up, one can trigger the behavior, if <code>alwaysSend</code> is set to true, the message will be sent synchronously
        if the flag is false, an error is thrown
      </attribute>
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index bcafaece47..d205ca7ef0 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -149,7 +149,7 @@
       <p>The maximum size in bytes of the POST which will be handled by
       the container FORM URL parameter parsing. The limit can be disabled by
       setting this attribute to a value less than zero. If not specified, this
-      attribute is set to 2097152 (2 megabytes). Note that the
+      attribute is set to 2097152 (2 MiB). Note that the
       <a href="filter.html#Failed_Request_Filter"><code>FailedRequestFilter</code></a>
       can be used to reject requests that exceed this limit.</p>
     </attribute>
@@ -401,7 +401,7 @@
       your bandwidth) and using the sendfile feature (saving your CPU cycles).
       If the connector supports the sendfile feature, e.g. the NIO connector,
       using sendfile will take precedence over compression. The symptoms will
-      be that static files greater that 48 Kb will be sent uncompressed.
+      be that static files greater that 48 KiB will be sent uncompressed.
       You can turn off sendfile by setting <code>useSendfile</code> attribute
       of the connector, as documented below, or change the sendfile usage
       threshold in the configuration of the
@@ -528,7 +528,7 @@
       <p>Provides the default value for
       <strong>maxHttpRequestHeaderSize</strong> and
       <strong>maxHttpResponseHeaderSize</strong>. If not specified, this
-      attribute is set to 8192 (8 KB).</p>
+      attribute is set to 8192 (8 KiB).</p>
     </attribute>
 
     <attribute name="maxHttpRequestHeaderSize" required="false">
@@ -569,7 +569,7 @@
       aborted upload is when Tomcat knows that the request body is going to be
       ignored but the client still sends it. If Tomcat does not swallow the body
       the client is unlikely to see the response. If not specified the default
-      of 2097152 (2 megabytes) will be used. A value of less than zero indicates
+      of 2097152 (2 MiB) will be used. A value of less than zero indicates
       that no limit should be enforced.</p>
     </attribute>
 
diff --git a/webapps/docs/config/resources.xml b/webapps/docs/config/resources.xml
index cea5c69edc..4bad617355 100644
--- a/webapps/docs/config/resources.xml
+++ b/webapps/docs/config/resources.xml
@@ -80,7 +80,7 @@
       <attribute name="cacheMaxSize" required="false">
         <p>The maximum size of the static resource cache in kilobytes.
         If not specified, the default value is <code>10240</code>
-        (10 megabytes). This value may be changed while the web application is
+        (10 MiB). This value may be changed while the web application is
         running (e.g. via JMX). If the cache is using more memory than the new
         limit the cache will attempt to reduce in size over time to meet the
         new limit. If necessary, <strong>cacheObjectMaxSize</strong> will be
diff --git a/webapps/docs/config/systemprops.xml b/webapps/docs/config/systemprops.xml
index 71420b234b..d13afe5660 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -556,7 +556,7 @@
 
     <property name="org.apache.tomcat. websocket.DEFAULT_BUFFER_SIZE">
       <p>The default size for buffers used in the Websockets container.</p>
-      <p>The default value is <code>8192</code> which corresponds to 8KB.</p>
+      <p>The default value is <code>8192</code> which corresponds to 8KiB.</p>
     </property>
 
     <property name="org.apache.tomcat. websocket.DEFAULT_ORIGIN_HEADER_VALUE">
diff --git a/webapps/docs/default-servlet.xml b/webapps/docs/default-servlet.xml
index 5b9ba7af29..33ce47e434 100644
--- a/webapps/docs/default-servlet.xml
+++ b/webapps/docs/default-servlet.xml
@@ -188,7 +188,7 @@ Tomcat.</p>
   </property>
   <property name="sendfileSize">
         If the connector used supports sendfile, this represents the minimal
-        file size in KB for which sendfile will be used. Use a negative value
+        file size in KiB for which sendfile will be used. Use a negative value
         to always disable sendfile. [48]
   </property>
   <property name="useAcceptRanges">
diff --git a/webapps/docs/security-howto.xml b/webapps/docs/security-howto.xml
index e7b92df174..6f61314af4 100644
--- a/webapps/docs/security-howto.xml
+++ b/webapps/docs/security-howto.xml
@@ -278,14 +278,14 @@
 
       <p>The <strong>maxPostSize</strong> attribute controls the maximum size
       of a POST request that will be parsed for parameters. The parameters are
-      cached for the duration of the request so this is limited to 2MB by
+      cached for the duration of the request so this is limited to 2MiB by
       default to reduce exposure to a DOS attack.</p>
 
       <p>The <strong>maxSavePostSize</strong> attribute controls the saving of
       the request body during FORM and CLIENT-CERT authentication and HTTP/1.1
       upgrade. For FORM authentication, the request body is cached in the HTTP
       session for the duration of the authentication so the cached request body
-      is limited to 4KB by default to reduce exposure to a DOS attack. To
+      is limited to 4 KiB by default to reduce exposure to a DOS attack. To
       further reduce exposure to a DoS attack by limiting the permitted duration
       of the FORM authentication, a reduced session timeout is used if the
       session is created by the FORM authentication. This reduced timeout is
diff --git a/webapps/docs/windows-service-howto.xml b/webapps/docs/windows-service-howto.xml
index 58c26c1e20..96ddb1bab9 100644
--- a/webapps/docs/windows-service-howto.xml
+++ b/webapps/docs/windows-service-howto.xml
@@ -288,17 +288,17 @@
       <tr>
         <td>--JvmMs</td>
         <td></td>
-        <td>Initial memory pool size in MB. (Not used in <b>exe</b> mode.)</td>
+        <td>Initial memory pool size in MiB. (Not used in <b>exe</b> mode.)</td>
       </tr>
       <tr>
         <td>--JvmMx</td>
         <td></td>
-        <td>Maximum memory pool size in MB. (Not used in <b>exe</b> mode.)</td>
+        <td>Maximum memory pool size in MiB. (Not used in <b>exe</b> mode.)</td>
       </tr>
       <tr>
         <td>--JvmSs</td>
         <td></td>
-        <td>Thread stack size in KB. (Not used in <b>exe</b> mode.)</td>
+        <td>Thread stack size in KiB. (Not used in <b>exe</b> mode.)</td>
       </tr>
       <tr>
         <td>--StartMode</td>
diff --git a/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java b/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
index 096dfb951b..9cc2c16871 100644
--- a/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
+++ b/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
@@ -50,7 +50,7 @@ public class CompressionFilter extends GenericFilter {
     /**
      * Minimal reasonable buffer.
      */
-    // 8KB is what tomcat would use by default anyway
+    // 8KiB is what tomcat would use by default anyway
     private static final int MIN_BUFFER = 8192;
 
     /**
diff --git a/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java b/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
index 080bfc2385..d22c6bccb3 100644
--- a/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
+++ b/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
@@ -82,7 +82,7 @@ public class CompressionServletResponseWrapper
     /**
      * The compression buffer size
      */
-    protected int compressionBuffer = 8192;  // 8KB default
+    protected int compressionBuffer = 8192;  // 8KiB default
 
     /**
      * The mime types to compress
diff --git a/webapps/manager/WEB-INF/web.xml b/webapps/manager/WEB-INF/web.xml
index ac70577a25..7d7a15ab47 100644
--- a/webapps/manager/WEB-INF/web.xml
+++ b/webapps/manager/WEB-INF/web.xml
@@ -53,7 +53,7 @@
     </init-param>
     -->
     <multipart-config>
-      <!-- 50MB max -->
+      <!-- 50MiB max -->
       <max-file-size>52428800</max-file-size>
       <max-request-size>52428800</max-request-size>
       <file-size-threshold>0</file-size-threshold>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org