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

Jean-Noel Rouvignac
17.17.2014 652e4ed09391b80d4e2472b8172347d5f2a34e9b
OPENDJ-1560 modify/modifyrdn operations are not working in mix replication topology

There is a mismatch between code before and after r10757.
This is affecting 2.6.x and 2.6.next OpenDJ servers communicating with each other.
Before r10757, serialized ModifyMsg included a zero separator after byte arrays, after r10757 it did not.
This change is introducing back the zero separator.

ModifyMsg.java:
In getBytes_V45(), appended the zero byte separator after byte arrays + adapted decodeBody_V4() code for it.
1 files modified
11 ■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/replication/protocol/ModifyMsg.java 11 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/protocol/ModifyMsg.java
@@ -34,7 +34,11 @@
import org.opends.server.core.ModifyOperationBasis;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.replication.common.CSN;
import org.opends.server.types.*;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.LDAPException;
import org.opends.server.types.Modification;
import org.opends.server.types.RawModification;
import org.forgerock.opendj.ldap.ByteString;
import org.opends.server.types.operation.PostOperationModifyOperation;
@@ -198,9 +202,9 @@
    final ByteArrayBuilder builder =
        encodeHeader(MSG_TYPE_MODIFY, protocolVersion);
    builder.appendIntUTF8(encodedMods.length);
    builder.appendByteArray(encodedMods);
    builder.appendZeroTerminatedByteArray(encodedMods);
    builder.appendIntUTF8(encodedEclIncludes.length);
    builder.appendByteArray(encodedEclIncludes);
    builder.appendZeroTerminatedByteArray(encodedEclIncludes);
    return builder.toByteArray();
  }
@@ -219,6 +223,7 @@
  {
    final int modsLen = scanner.nextIntUTF8();
    this.encodedMods = scanner.nextByteArray(modsLen);
    scanner.skipZeroSeparator();
    final int eclAttrLen = scanner.nextIntUTF8();
    encodedEclIncludes = scanner.nextByteArray(eclAttrLen);