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

Jean-Noel Rouvignac
17.03.2014 c909d2e1e1139721ec9ed0bbc0fdef7febd6b16a
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
opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java 11 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java
@@ -34,7 +34,11 @@
import org.opends.server.protocols.asn1.ASN1Exception;
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.opends.server.types.operation.PostOperationModifyOperation;
import static org.opends.server.replication.protocol.OperationContext.*;
@@ -197,9 +201,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();
  }
@@ -218,6 +222,7 @@
  {
    final int modsLen = scanner.nextIntUTF8();
    this.encodedMods = scanner.nextByteArray(modsLen);
    scanner.skipZeroSeparator();
    final int eclAttrLen = scanner.nextIntUTF8();
    encodedEclIncludes = scanner.nextByteArray(eclAttrLen);