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

Chris Ridd
18.31.2014 15639797b80c1667a0e91d0e467227da95d3cd49
Fix OPENDJ-1516: Trunk sends MSG_TYPE_REPLICA_OFFLINE messages to a v7 DS
3 files modified
12 ■■■■■ changed files
opends/src/server/org/opends/server/replication/protocol/ReplicaOfflineMsg.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ReplicationMsg.java 3 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/Session.java 5 ●●●●● patch | view | raw | blame | history
opends/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);
opends/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);
opends/src/server/org/opends/server/replication/protocol/Session.java
@@ -325,6 +325,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)