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

Chris Ridd
18.51.2014 22ec3dd24c3af40cc6e67318cf83b88e55242d06
Forward port fix OPENDJ-1516: Trunk sends MSG_TYPE_REPLICA_OFFLINE messages to a v7 DS
3 files modified
12 ■■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/replication/protocol/ReplicaOfflineMsg.java 4 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/protocol/ReplicationMsg.java 3 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/protocol/Session.java 5 ●●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/replication/protocol/ReplicaOfflineMsg.java
@@ -90,6 +90,10 @@
  @Override
  public byte[] getBytes(short protocolVersion)
  {
    if (protocolVersion < ProtocolVersion.REPLICATION_PROTOCOL_V8)
    {
      return null;
    }
    final ByteArrayBuilder builder = new ByteArrayBuilder(size());
    builder.appendByte(MSG_TYPE_REPLICA_OFFLINE);
    builder.appendShort(protocolVersion);
opendj3-server-dev/src/server/org/opends/server/replication/protocol/ReplicationMsg.java
@@ -107,7 +107,8 @@
   * @param protocolVersion
   *          The protocol version to use for serialization. The version should
   *          normally be older than the current one.
   * @return The encoded PDU.
   * @return The encoded PDU, or <code>null</code> if the message isn't supported
   *          in that protocol version.
   */
  public abstract byte[] getBytes(short protocolVersion);
opendj3-server-dev/src/server/org/opends/server/replication/protocol/Session.java
@@ -319,6 +319,11 @@
  public void publish(final ReplicationMsg msg) throws IOException
  {
    final byte[] buffer = msg.getBytes(protocolVersion);
    if (buffer == null)
    {
      // skip anything that cannot be encoded for this peer.
      return;
    }
    if (isRunning.get())
    {
      while (!closeInitiated)