From 99480fcbcb68be6a357f6218668feab697e1a93d Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Tue, 07 Jul 2009 14:55:26 +0000
Subject: [PATCH] Fix for 4096 MonitorMsg is not compatible with replication version

---
 opends/src/server/org/opends/server/replication/protocol/ReplicationMsg.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/ReplicationMsg.java b/opends/src/server/org/opends/server/replication/protocol/ReplicationMsg.java
index 3f70856..5ef9135 100644
--- a/opends/src/server/org/opends/server/replication/protocol/ReplicationMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/ReplicationMsg.java
@@ -125,14 +125,19 @@
    * is done taking into account the various supported replication protocol
    * versions.
    *
-   * @param buffer The encode form of the ReplicationMsg.
+   * @param buffer    The encode form of the ReplicationMsg.
+   * @param version   The version to use to decode the msg.
+   *
    * @return The generated SycnhronizationMessage.
+   *
    * @throws DataFormatException If the encoded form was not a valid msg.
    * @throws UnsupportedEncodingException If UTF8 is not supported.
    * @throws NotSupportedOldVersionPDUException If the PDU is part of an old
    * protocol version and we do not support it.
    */
-  public static ReplicationMsg generateMsg(byte[] buffer)
+  public static ReplicationMsg generateMsg(
+                byte[] buffer,
+                short version)
                 throws DataFormatException, UnsupportedEncodingException,
                 NotSupportedOldVersionPDUException
   {
@@ -207,7 +212,7 @@
         msg = new MonitorRequestMsg(buffer);
       break;
       case MSG_TYPE_REPL_SERVER_MONITOR:
-        msg = new MonitorMsg(buffer);
+        msg = new MonitorMsg(buffer, version);
       break;
       case MSG_TYPE_START_SESSION:
         msg = new StartSessionMsg(buffer);

--
Gitblit v1.10.0