mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
16.33.2006 3cf5c194f00ddecc9b54d2ffed9ca10a8e6f2208
Update the LDAP connection handler so that the size units for the max request
size configuration attribute are consistent with the size units used in various
configuration attributes for the JE backend. In particular, the following are
now true:

- KB refers to kilobytes, or 1000 bytes
- KiB refers to kibibytes, or 1024 bytes
- MB refers to megabytes, or 1000000 bytes
- MiB refers to mebibytes, or 1048576 bytes

Previously, only KB and MB were defined and they used the "power of 2" form
rather than the "power of 10" form.
1 files modified
22 ■■■■■ changed files
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java 22 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -121,6 +121,14 @@
  /**
   * The unit string that will be used to designate that a value is in
   * kibibytes.
   */
  public static final String UNIT_KIBIBYTES = "KiB";
  /**
   * The unit string that will be used to designate that a value is in
   * megabytes.
   */
  public static final String UNIT_MEGABYTES = "MB";
@@ -128,6 +136,14 @@
  /**
   * The unit string that will be used to designate that a value is in
   * mebibytes.
   */
  public static final String UNIT_MEBIBYTES = "MiB";
  /**
   * The hash map that holds the units that may be provided in conjunction with
   * the maximum request size.
   */
@@ -137,8 +153,10 @@
  static
  {
    SIZE_UNITS.put(UNIT_BYTES, 1.0);
    SIZE_UNITS.put(UNIT_KILOBYTES, 1024.0);
    SIZE_UNITS.put(UNIT_MEGABYTES, 1048576.0);
    SIZE_UNITS.put(UNIT_KILOBYTES, 1000.0);
    SIZE_UNITS.put(UNIT_KIBIBYTES, 1024.0);
    SIZE_UNITS.put(UNIT_MEGABYTES, 1000000.0);
    SIZE_UNITS.put(UNIT_MEBIBYTES, 1048576.0);
  }